Skip to content

fix(backend): stop capturing tool results as the user query - #154

Open
DevMello wants to merge 1 commit into
MemTensor:v1.0.5from
DevMello:fix/hook-stop-capture-query
Open

fix(backend): stop capturing tool results as the user query#154
DevMello wants to merge 1 commit into
MemTensor:v1.0.5from
DevMello:fix/hook-stop-capture-query

Conversation

@DevMello

@DevMello DevMello commented Aug 5, 2026

Copy link
Copy Markdown

Claude Code transcripts store tool results as user-role records. When a Stop event has no pending turn state (the turn after a /memmy-resume selection, or a hook installed mid-session), the transcript fallback picked the newest of those records, so file dumps got saved to memory as the user's query.

Fix: tool_result records are classified as tool messages, matching the Codex branches, so the fallback finds the real prompt. The new test replays a Stop event through the rendered hook script and fails before this change.

Claude Code transcripts store tool results as user-role records, so
the Stop-event transcript fallback could save tool output to memory
as the user's query. Classify tool_result records as tool messages
so the fallback finds the real prompt.
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.

1 participant