Log the start of model reasoning in background job logs#480
Open
cubicj wants to merge 1 commit into
Open
Conversation
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
Background job logs (
state/<slug>-<hash>/jobs/<id>.log) go silent during reasoning stretches. Every other item type already logs a start line viadescribeStartedIteminplugins/codex/scripts/lib/codex.mjs:commandExecution("Running command: ..."),fileChange("Applying N file change(s)."),mcpToolCall,dynamicToolCall,collabAgentToolCall, andwebSearch.reasoningis the only started item type that falls through todefault: return null, so nothing is written and anyone tailing a job log cannot tell whether the model is thinking or the job is stuck.Change
Add a
reasoningcase todescribeStartedItemthat emitsThinking.withphase: null. The message follows the existing period-terminated declarative style ("Turn completed.", "File changes completed.").phasestays null deliberately: none of the existing phase values (starting/running/editing/investigating/verifying/reviewing/finalizing) describes reasoning, and inventing a new phase would widen the change beyond logging.Verification
[<iso-ts>] Thinking.line at the start of each reasoning block. This confirms the app-server deliversitem/startedfor reasoning items; the stock plugin currently drops them.npm test: 91/91 passing. The fake-codex fixture only emits completed reasoning items, so no existing test output changes.npm run build: clean.Noise consideration
Reasoning blocks complete every few seconds during long thinking stretches, so this adds one short line per block rather than one line per turn. Consumers that want a quieter view can collapse consecutive markers; the downstream log watcher @cubicj/codex-watch 0.3.0 already renders them as a single collapsed "Thinking..." indicator.
Related
.events.jsonlstream via/codex:observe; this change instead improves the existing.logfiles that current tooling tails, and the two are complementary.