Repository navigation
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 |
Contributor
|
@genisis0x Please enforce a role boundary in the current-schema parser so developer instructions cannot be ingested as memory content. |
Codex rollout records carry role user|assistant|developer. The rollout parser ingested every role, so developer (system-level) instructions were captured as memory content. An injected developer instruction inside a rollout would then resurface later as trusted memory. Add an INGESTIBLE_ROLES allowlist (user, assistant) and skip any other role in both Codex shapes (legacy payload.message and current response_item). Regression test asserts a developer directive is dropped while the user and assistant turns still render.
Contributor
|
Thank you for this fix! The bug it addresses (#2105) has since been fixed on main and the issue is closed, so I'm closing this PR as done. Re-verified against current main (v1.91.12.0). If you think part of your change is still missing, reply and we'll reopen. Really appreciate the contribution. |
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).