Description
Bug
Sessions created via the OpenCode plugin show raw IDs (e.g. ses_abc123) in the viewer and MCP memory_sessions output instead of human-readable names. The firstPrompt and summary fields are empty.
Root cause
The OpenCode plugin sends a title field with session.created → POST /agentmemory/session/start, but api::session::start in src/triggers/api.ts completely ignores it. The session is created with no firstPrompt or summary.
Additionally, there's a race condition: chat.message → prompt_submit can arrive at the server via async POST before the session is created, so firstPrompt never gets set even when the user prompt is available.
Fix
api::session::start now reads body.title and stores it as both summary and firstPrompt on the new session, so sessions have a human-readable name from creation time regardless of prompt_submit timing.
Activity
rohitg00 commentedon May 8, 2026
Thanks @cl0ckt0wer — confirmed the bug.
api::session::startinsrc/triggers/api.tsonly readssessionId+project+cwd+timestampfrom the body;title(and the related fields you'd want for a human-readable session row —firstPrompt,summary) are silently dropped.Compounded by the
chat.message → prompt_submitrace you flagged: if the prompt observation lands before the session row is committed, even the late-fill path misses.Triaged for the next OpenCode plugin pass. The cleanest fix is what you proposed: read
body.titleinapi::session::startand seed bothsummaryandfirstPromptso the session has a human-readable name from creation, independent ofprompt_submitordering.Two notes for whoever lands the fix:
mem::session::listand the viewer's session picker, otherwise the names won't surface even after the API stores them.plugin/opencode/agentmemory-capture.ts(landing in feat: OpenCode plugin with 22 auto-capture hooks (closes #236, #244) #237 / fix(plugin): add session instruction injection and consolidation pipeline (closes #233) #239) is the canonical place to start sendingtitlefrom. Confirm the field name matches what the patched server reads.Leaving this open until the patch lands. Happy to take a PR if you want to bundle it with the OpenCode plugin work — they touch overlapping surface.
feat: OpenCode plugin with 22 auto-capture hooks (closes #236, #244) (#…
feat: OpenCode plugin with 22 auto-capture hooks (closes rohitg00#236, …