Repository navigation
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.
What changed
Long Codex conversations can fail on the next message with
原生进程输出超过缓冲限制before a new turn starts. The adapter requeststhread/resumewith the full history, but the conversation process cancels when unacknowledged stdout/stderr exceeds 8 MiB. A single large resume response can exceed that quota even when polling is keeping up.Set
excludeTurns: trueonly onthread/resume. The adapter only consumesresult.thread.id, so returning the historical turns is unnecessary. The existing thread is resumed and the next prompt is sent to that same thread. This leaves the output quota, fresh-thread requests, and missing-session recovery unchanged.Add regression coverage for the resume parameter, an empty-turns response followed by a completed turn on the same saved thread, and the absence of this resume-only parameter on
thread/start.Reproduction evidence
Using Codex CLI 0.162.1 and a failure-time rollout copied into isolated temporary Codex homes:
thread/resumerequestexcludeTurns: trueThe full response contained 34 turns and 985 items. Both protocol probes completed successfully outside LoopForge's bounded output queue. No
turn/startwas sent during the probes, no model generation was requested, and the original rollout remained unchanged. Only aggregate measurements are shared here; the rollout, session identifiers, credentials, and deployment details are not included.Scope
Compatibility
Applies to Codex chat resumptions on platform and bound-runner execution paths. The bundled Codex 0.162.1 supports
excludeTurns; other CLI versions were not independently exercised. No database migration, new dependency, runner-protocol change, output-quota increase, or thread-history deletion. Real model generation after resume was not exercised in this change.Validation
Passed:
TestCodexAppServerResumeWithoutHistoryfirst and confirmed it fails against the original implementation becauseexcludeTurnsis missing.go test ./internal/httpapi -run '^TestCodexAppServer' -count=1 -timeout=120safter the fix, including an independent reviewer rerun.go test ./internal/runtime -run '^TestConversation(CLIVersionPreservesOutputQuota|ProcessBidirectionalAndRootFence)$' -count=1 -timeout=60s.bash scripts/build-chatbot.sh: 63 test files / 552 tests passed; Vite build passed.go vet ./....python3 scripts/check-public.py.git diff --checkand gofmt.Full-suite limitations:
go test -p=2 ./... -count=1 -timeout=180swas run on macOS arm64 and did not pass. Failures occurred incmd/agentflow(Unix datagram socket),deploy(background-runner PID cases),internal/gitwork(workspace path),internal/runner(stopped-transfer fixture), andinternal/runtime(sandbox/path cases).internal/engineandinternal/httpapireached the timeout in browser/workspace tests. These failures were not investigated or established as pre-existing by this scoped change; this is not a full-suite pass.bash scripts/scan-secrets.shdownloads a Linux x64 executable and exited 126 on macOS; the equivalent checksum-verified native scan above passed.Safety