-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Labels
status:approvedApproved for implementationApproved for implementation
Description
Context
PR #47 fixes session-stop for Claude Code by calling POST /sessions/{id}/end from the hook. But the other three agents have no equivalent — their sessions always have ended_at = NULL.
Current state
| Agent | Session start | Session end |
|---|---|---|
| Claude Code | session-start.sh hook → POST /sessions |
session-stop.sh hook → POST /sessions/{id}/end (PR #47) |
| OpenCode | engram.ts plugin → POST /sessions |
Nothing |
| Gemini CLI | MCP mem_session_start via protocol |
Nothing |
| Codex | MCP mem_session_start via protocol |
Nothing |
What's already available
The MCP tool mem_session_end exists and works. Agents just need to be told to call it.
Proposed fix per agent
- OpenCode: Add a session-end event handler in
engram.tsthat callsPOST /sessions/{id}/end(same pattern as the session creation handler) - Gemini CLI: Add instruction in the system prompt telling the agent to call
mem_session_endbefore closing - Codex: Add instruction in the memory config telling the agent to call
mem_session_endbefore closing
Why it matters
Without ended_at, session duration is unknown, the session list grows unbounded with no way to tell which sessions are active vs finished, and any future cleanup/retention logic can't distinguish stale sessions from ongoing ones.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status:approvedApproved for implementationApproved for implementation