Repository navigation
Rename references to Agent Code - #3
Merged
Merged
Conversation
…dy + request_shape
Codex's proxy events used to fly through EventEmitter only — no
on-disk record. The Claude proxy has had `proxy-events.jsonl` since
day one and that's been load-bearing for forensic work against debug
bundles ("what was the actual prompt that triggered this leak?").
Codex needs the same capability, in the same on-disk shape, so a
single bundle-inspection tool can read either provider without
branching.
Three additions, all gated on a new `eventsFile?: string` option that
defaults to undefined (existing testing harness callers see no
change):
1. ResponsesProxy.emit() override mirrors every emitted event into
the JSONL file when configured. Done at emit (not in each handler)
so any current or future event kind lands on disk consistently.
Buffer-typed values (response-chunk's raw upstream bytes) get
substituted with a base64 sidecar at JSON.stringify time so the
mirror file stays human-decodable without forcing all callers to
pre-encode.
2. The `request` event payload gains:
- headers filtered to an allowlist (x-codex-*,
x-openai-subagent, user-agent, content-length,
content-type, openai-beta). Authorization is
structurally excluded so the file is safe to
ship in a debug bundle.
- body_b64 raw request body up to a 2 MiB cap (matches
Claude's mitmAddon for symmetry).
- request_shape pre-parsed metadata: model, instructions_chars,
input_items_count, tools_count, has_reasoning.
Forensic-only today; future predicate work has
a structured slot to read from.
3. CodexResponsesAdapter tightens its endpoint filter from
`path.includes('/responses')` (which substring-matched
/responses/compact too) to the typed `endpoint === 'responses'`
label the proxy already emits. Falls back to the legacy substring
check when an older proxy doesn't send `endpoint`. Either way,
/responses/compact, /memories/trace_summarize, /realtime/calls,
/models, and unclassified /v1/ paths no longer touch the
active-flow attribution state machine.
Allowlist sources: vendor/codex-src/codex-rs/core/src/client.rs
(build_responses_options, build_subagent_headers,
build_responses_identity_headers).
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.
Summary
Verification