fix(memory-ingest): render Codex rollout message bodies#2132
Open
genisis0x wants to merge 1 commit into
Open
Conversation
Codex rollout JSONL now carries each turn as a `response_item` record
with the message on `payload.{type:"message", role, content[]}`, not on
the legacy `payload.message`. parseTranscriptJsonl only read
`payload.message`, so every Codex session imported with an empty body and
message_count 0.
Handle the current `payload.type === "message"` shape alongside the
legacy wrapper: read `payload.role` and flatten `payload.content`. Adds a
product-path regression that ingests a response_item session and asserts
the staged transcript renders both the user and assistant turns (fails on
the old parser with an empty body).
Closes garrytan#2105
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2105.
Problem
gstack-memory-ingestrenders every Codex rollout session with an empty body (message_count: 0). Current Codex rollout JSONL carries each turn as aresponse_itemrecord with the message onpayload.{type:"message", role, content[]}:but
parseTranscriptJsonl(bin/gstack-memory-ingest.ts) only extracts content whenrec.payload.messageis present (the older shape). That branch never fires on the current format, so the message loop counts zero turns and stages an empty page for every Codex transcript.Fix
Handle the current
payload.type === "message"shape alongside the legacypayload.messagewrapper: readpayload.roleand flattenpayload.contentthrough the existingextractContentTexthelper. Legacy sessions keep working.Test
Adds a product-path regression in
test/gstack-memory-ingest.test.tsthat ingests aresponse_item-format Codex session through the full--bulkpath (fake-gbrain staging shim, same pattern as the NUL-byte test) and asserts the staged transcript renders both the user and assistant turns. It fails on the old parser (staged body empty,message_count: 0) and passes with the fix.bun test test/gstack-memory-ingest.test.ts-> 24 pass. No template/SKILL.md change, so no regeneration; no VERSION bump (same as other bin/skill bug-fix PRs).