Skip to content

fix: OpenCode sessions show raw IDs instead of human-readable names #244

Closed

Description

@cl0ckt0wer

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

  1. rohitg00 commented on May 8, 2026

    @rohitg00
    Owner

    Thanks @cl0ckt0wer — confirmed the bug. api::session::start in src/triggers/api.ts only reads sessionId + project + cwd + timestamp from 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_submit race 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.title in api::session::start and seed both summary and firstPrompt so the session has a human-readable name from creation, independent of prompt_submit ordering.

    Two notes for whoever lands the fix:

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions