Repository navigation
feat(codex): send the response and request settings of each model request - #333
Merged
Merged
Conversation
…uest On PostModelRequest the plugin reads the response of that request from the rollout file and adds its text, the tool calls it asked for (id and name), the phase and the turn's reasoning settings: response / request in event_data on the hooks export, agentguard.response.* / agentguard.request.* span attributes on the otel export. The hook payload and the rollout file share no id that is known to match, so the request is found by its turn and token counts, with a wait of up to 0.5 s for lines that are not written yet. When it is not found the event is sent as before. AGENTGUARD_LLM_CONTENT=false leaves the text out; AGENTGUARD_LLM_CONTENT_CHARS sets the cut (default 4000). Version 0.4.0. Closes #332 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 30, 2026
Closed
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 #332. The Codex half of #330; the Claude Code half was #331.
What changes
On
PostModelRequestthe plugin reads the response of that request from the rollout file (transcript_path) and adds it to the event:hooksexport (event_data)otelexport (span attribute)response.textagentguard.response.textAGENTGUARD_LLM_CONTENT_CHARS(default 4000); left out withAGENTGUARD_LLM_CONTENT=falseresponse.text_charsagentguard.response.text_charsresponse.tool_callsagentguard.response.tool_calls(JSON)[{id, name}], the id is the transcript'scall_idresponse.phaseagentguard.response.phasecommentary/final_answerrequest.effort,request.summaryagentguard.request.effort,.summaryagentguard_codex/transcript.py. It reads only the last 8 MB of the file.request_idis not known to match the rollout'sresponse_id. When it is not found, the event is sent as before.llm.output_messages, so the app's current views do not start showing commentary before a tool call as the assistant message. The app opts in when it reads the new names.docs/plugin-install.md,docs/cim.md, the skill,CLAUDE.md.Tested
hooksexport against a local capture server, with a real rollout file.Not tested
PostModelRequestfires. Codex does not run a new hook until it is trusted in/hooks, so this was not run inside a live Codex session. If the lines arrive later, the plugin waits up to 0.5 s per model request (Codex waits for the hook) and then sends the event without the new fields.otelexport against a real collector.🤖 Generated with Claude Code