Skip to content

memmy-agent 第二条消息固定报错 session not found #2327

Closed as not planned

Description

@Memtensor-AI

现象

memmy-agent 启动后首次对话正常,但发送第二条消息时会固定报 session not found;新建会话后仍可稳定复现。

复现情况

  • 首次对话正常
  • 第二条消息必现报错
  • 新建会话后仍可复现

备注

OpenClaw 知识库未匹配到解决方案。

Activity

  1. added
    ai:taskDispatched to AI coding agent | 已派发给 AI 编码任务
    status:in-progressSomeone or AI is working on it | 人工或 AI 正在处理
    on Sep 2, 2026
  2. added
    ai:codingAI agent is coding | AI 正在编码
    types:bugSomething isn't working | 功能异常
    on Sep 2, 2026
  3. self-assigned this
    on Sep 2, 2026
  4. Memtensor-AI commented on Sep 2, 2026

    @Memtensor-AI
    CollaboratorAuthor

    🤖 AutoDev has picked up this issue and started working on it.

    Task ID: 1d452ba963e2f9cb
    Working branch: bugfix/autodev-2327-20260902070028337
    Target branch: latest dev* branch
    Workflow: opsp (analysis → coding → testing → PR)

    I will post the PR link here once done. If I need more information, I will ask in the comments.

  5. Memtensor-AI commented on Sep 2, 2026

    @Memtensor-AI
    CollaboratorAuthor

    ✅ AutoDev task 1d452ba963e2f9cb completed.

    Summary: Fixed #2327: memmy-agent second-message "session not found" error.

    Root cause: apps/memos-local-plugin/core/pipeline/memory-core.ts::closeSession threw MemosError("session_not_found") when the session was no longer in the orchestrator's in-memory live map. After the first message, the adapter's on_session_end hook calls session.close which evicts the session from the live map. Any subsequent duplicate close (lifecycle race, adapter retry, memmy-agent bridge re-firing) hit the null branch and threw, surfacing to the user on the second message.

    Fix: Made closeSession idempotent — unknown session ids are a silent no-op with a debug log, matching the existing semantics of closeEpisode/discardEmptyEpisode. Added 4 regression tests in tests/unit/pipeline/regression-2327-second-message.test.ts. All 176 session + pipeline unit tests pass.

    Changed files: core/pipeline/memory-core.ts (fix), core/pipeline/README.md + ALGORITHMS.md (doc update), tests/unit/pipeline/regression-2327-second-message.test.ts (new regression tests).

    Base branch: main
    Branch: bugfix/autodev-2327-20260902070028337
    Commit: 3cb77e5
    PR: #2328
    Assigned to: @whipser030
    Reviewers: @whipser030, @hijzy

  6. added
    ai:testingAI agent is running tests | AI 正在运行测试
    ai:pr-readyAI-created PR is ready for review | AI 生成的 PR 已等待评审
    and removed
    ai:codingAI agent is coding | AI 正在编码
    ai:testingAI agent is running tests | AI 正在运行测试
    ai:taskDispatched to AI coding agent | 已派发给 AI 编码任务
    on Sep 2, 2026
  7. github-actions commented on Oct 4, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale due to inactivity.

  8. added
    status:staleAuto-marked stale after 30d inactivity; closes 7d later unless exempt.
    on Oct 4, 2026
  9. github-actions commented on Oct 15, 2026

    @github-actions
    Contributor

    This issue has been automatically closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ai:pr-readyAI-created PR is ready for review | AI 生成的 PR 已等待评审area:pluginOpenClaw & Hermesstatus:in-progressSomeone or AI is working on it | 人工或 AI 正在处理status:staleAuto-marked stale after 30d inactivity; closes 7d later unless exempt.types:bugSomething isn't working | 功能异常

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions