Skip to content

修复:复用占用 18960 端口的兼容 Memory 服务 - #600

Merged
origami-chen merged 13 commits into
MemTensor:v1.2.3from
jia030928:fix-bug-476-memory-port-conflict
Oct 13, 2026
Merged

origami-chen merged 13 commits into
MemTensor:v1.2.3from
jia030928:fix-bug-476-memory-port-conflict

Conversation

@jia030928

Copy link
Copy Markdown

问题说明

通过 dev-start 启动 Memmy 后,Memory 服务已经监听 18960 端口。此时再打开打包版,如果现有 Memory 服务因模型异常而在健康接口中返回 ok: false,桌面端会将其误判为未知服务,并尝试在同一端口启动第二个 Memory 进程,最终提示端口被占用、记忆服务不可用。

修复内容

  • 根据健康响应结构和协议版本识别 Memory 服务。
  • 当现有服务协议兼容但模型健康状态为异常时,继续复用该服务,不再启动第二个监听进程。
  • 对格式错误的响应和不兼容的协议版本继续保持拒绝。
  • 新增回归测试,模拟 dev-start 服务返回降级健康状态,并验证桌面端不会创建第二个 Memory 子进程。

验证结果

  • npm exec -w @memmy/desktop -- vitest run tests/runtime-services.test.ts:57 项通过
  • npm run typecheck -w @memmy/desktop:通过
  • npm run package:mac:arm64:cn:unsigned:通过
  • hdiutil verify App/shell/desktop/release/Memmy-1.2.1-darwin-arm64-cn-unsigned.dmg:通过

Anson-Se and others added 13 commits September 26, 2026 13:17
…mand

A turn routed as end_topic used to be dropped from L1 capture as a whole,
so feedback, work conventions and instructions sent together with the
closing words never reached L1, user memory or the episode reward.

Only a bare end-topic command ("结束会话" / "不聊了") is still kept out of
L1. Every other end_topic turn now goes through the same capture decision
as a normal turn; the closed episode waits for that decision before
reflection and reward are queued.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every memmy-memory run reports memmy_cli_* events to the cloud analytics
endpoint. resolveCommandIdentity took the second positional word as
command_action unconditionally, which was meant for subcommands such as
`session close`. For search, add, get and delete that word is the search
query, the memory text or the memory id, so it was sent verbatim. An
unrecognized first word was also sent verbatim as command_group.

command_action is now reported only when the first word is a group with
subcommands (service, session, turn, raw) and the second word is one of
that group's known subcommands; raw methods match case-insensitively, as
runRaw does. An unrecognized first word is reported as command_group
"unknown". The known commands live in a small table in analytics.ts that
mirrors runCommand and mapTopLevelCommand. has_session_id and has_turn_id
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The session close route only woke the auto worker when the close result
listed closed episodes, jobs, or scheduled evolution. For an L3 World
Model v2 session, closeSession also freezes the pending L3 evidence
batches and queues l3_world_model_update jobs, but it does not return
them. When the session's episode had already closed earlier (idle
timeout or end_topic), closedEpisodeIds was empty and nothing woke the
worker. The worker does not poll, so the new L3 jobs stayed queued until
an unrelated request happened to wake it.

The close route now always schedules the worker, as the token compaction
boundary already does after freezing batches. A close with no follow-up
work costs one empty drain. A new REST contract test closes an L3 v2
session whose episode had already ended and checks that the worker picks
up the frozen L3 job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-worker

fix(memory): wake the worker after every session close
v1.2.2 requires the turn capture decision to return a non-empty l1.title
together with l1.summary. The mixed feedback-and-closing test stub only
returned a summary, so the capture decision threw and the closing L1 stayed
in resolving instead of being activated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and-action

fix(memory): stop sending CLI arguments as analytics command actions
fix(memory): stop dropping end-topic turns that carry feedback from L1
Synchronize the latest code from the main branch to v1.2.2
…-format

fix: 兼容 LM Studio 的 JSON 响应格式
@jia030928
jia030928 requested a review from ZongYue99 as a code owner October 10, 2026 06:15
@syzsunshine219
syzsunshine219 changed the base branch from v1.2.2 to v1.2.3 October 12, 2026 12:45
@origami-chen
origami-chen merged commit 980ef05 into MemTensor:v1.2.3 Oct 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants