Log js_repl nested tool responses in rollout history#12837
Merged
Conversation
0a7dea3 to
079575a
Compare
97a3216 to
019d18f
Compare
pakrym-oai
approved these changes
Feb 26, 2026
Persist a sanitized summary for nested codex.tool() calls by default and keep the exact raw response or error only when extended rollout history is enabled.
019d18f to
ea24e55
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
codex.tool(...)calls made fromjs_replinfo!trace!codex app-serverWhy
Nested
codex.tool(...)calls insidejs_replare a debugging boundary: JavaScript sees the tool result, but that result is otherwise hard to inspect from outside the kernel.This change adds explicit tracing for that path using the repo’s normal observability pattern:
infofor compact summariestracefor exact raw payloads when deep debugging is neededWhat changed
js_replnow summarizes nested tool-call results across the response shapes it can receive:codex.tool(...)completion logs:exec_idtool_call_idtool_nameoktrace, the same path also logs the exact serialized response object or error string that JavaScript receivedcodex app-serverHow to use it
Summary-only logging
Set:
For
codex app-server, tracing output is written to the server processstderr.Example:
RUST_LOG=codex_core::tools::js_repl=info \ LOG_FORMAT=json \ codex app-server \ 2> /tmp/codex-app-server.logThis emits bounded summary lines for nested
codex.tool(...)calls.Full raw debugging
Set:
Example:
RUST_LOG=codex_core::tools::js_repl=trace \ LOG_FORMAT=json \ codex app-server \ 2> /tmp/codex-app-server.logAt
trace, you get:infosummary linetraceline with the exact serialized response object seen by JavaScriptWhere the logs go
For
codex app-server, these logs go to processstderr, so redirect or capturestderrto inspect them.Example:
RUST_LOG=codex_core::tools::js_repl=trace \ LOG_FORMAT=json \ /Users/fjord/code/codex/codex-rs/target/debug/codex app-server \ 2> /tmp/codex-app-server.logThen inspect:
rg "js_repl nested tool call" /tmp/codex-app-server.logWithout an explicit
RUST_LOGoverride, thesejs_replnested tool-call logs are typically not visible.