Skip to content

feat: capture Codex tool calls and results from response_item transcripts - #37

Open
ayushsingh82 wants to merge 1 commit into
supermemoryai:mainfrom
ayushsingh82:feat/codex-response-item-transcript-coverage
Open

feat: capture Codex tool calls and results from response_item transcripts#37
ayushsingh82 wants to merge 1 commit into
supermemoryai:mainfrom
ayushsingh82:feat/codex-response-item-transcript-coverage

Conversation

@ayushsingh82

@ayushsingh82 ayushsingh82 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Rebased onto current main. Since this was opened, main picked up the response_item user/assistant message parsing and the near-duplicate dedup independently, so this PR is now just the part that's still missing: tool context.

parseTranscript() still drops function_call and function_call_output entries, so automatic capture loses what command an agent ran and what it returned on any transcript that's mostly response_item-shaped. This adds them as "tool"-role entries, each bounded to 500 chars with a [truncated, N more chars] marker so a large tool result can't bloat a captured memory. Assistant message parsing also picks up text content blocks alongside output_text.

groupEntriesIntoTurns() in signals.ts carries "tool" entries into a turn's captured content but doesn't scan them for signal keywords — bounded tool output is noisy and shouldn't be what triggers a capture. transcript.ts is bundled to dist/services/transcript.js (same pattern as session.js / tags.js / resultMerge.js) so it can be unit-tested directly against fixtures.

This is part 1 of #13. Per-project tag overrides (part 2) are a separate change.

Checked:

  • npm run typecheck — clean.
  • npm test — 74/74 pass, including 5 new fixture tests under "Codex transcript parsing": input_text user extraction, output_text + text assistant extraction, function_call / function_call_output captured as bounded tool entries, no double-capture when a turn appears in both the event_msg and response_item shapes, and a regression guard that legacy event_msg-only transcripts still parse unchanged.

@ayushsingh82

Copy link
Copy Markdown
Contributor Author

@Dhravya parses full response_item transcript coverage (user/tool messages that were previously dropped). Please take a look.

…ipts

parseTranscript() handled response_item user and assistant messages but
dropped function_call and function_call_output entries entirely, so
automatic capture lost all tool context (what command ran, what it
returned) on transcripts that are mostly response_item-shaped.

Tool calls and results are now recorded as "tool"-role entries, bounded
to 500 chars with a truncation marker so raw tool output can't bloat a
captured memory. assistant message parsing also picks up "text" content
blocks alongside "output_text".

signals.ts's groupEntriesIntoTurns() carries "tool" entries into a
turn's captured content but doesn't scan them for signal keywords —
bounded tool output is noisy and shouldn't itself trigger a capture.
transcript.ts is bundled to dist/services/transcript.js so it can be
unit-tested directly against transcript fixtures.

Addresses supermemoryai#13 (part 1: transcript coverage). Per-project tag overrides
(part 2) are a separate change.
@ayushsingh82
ayushsingh82 force-pushed the feat/codex-response-item-transcript-coverage branch from c3b6d93 to 22352ce Compare September 4, 2026 13:07
@ayushsingh82 ayushsingh82 changed the title feat: parse full response_item transcript coverage (#13) feat: capture Codex tool calls and results from response_item transcripts Sep 4, 2026
@ayushsingh82

Copy link
Copy Markdown
Contributor Author

Rebased onto main and trimmed the scope — the message-parsing and dedup halves landed independently while this sat, so it's now just the function_call / function_call_output capture plus text blocks. Green on typecheck + 74 tests. @Dhravya

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