test(cli): reproduce a provider stream disconnect failing the node in the e2e campaign (#676) - #1262
Open
mrthankyou wants to merge 1 commit into
Open
mrthankyou wants to merge 1 commit into
mrthankyou wants to merge 1 commit into
Conversation
… the e2e campaign (#676) The e2e stub codex gains an opt-in stream-disconnect mode that replays what codex-cli 0.144.4 prints under `exec --json` when its provider stream drops and stays down: five `Reconnecting... n/5` errors, the final `stream disconnected before completion` error and `turn.failed`, then exit 1. A new campaign drops summarize's stream with a one-attempt budget and asserts the node still completes, as #676's acceptance asks. It is marked todo: today the node fails with executor-error and the run fails. The init and config steps move into initializeCampaign, shared with the resume test, and process cleanup no longer needs /proc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines
+655
to
+656
| for (const pid of [...processesMentioning(campaign.root), ...processesMentioning(campaign.runId)]) kill(pid); | ||
| removeTree(campaign.root); |
There was a problem hiding this comment.
Detached campaign survives cleanup If the workflow is still running when polling times out on macOS,
processesMentioning returns no PIDs because /proc is absent. Cleanup then removes the fixture without stopping the detached campaign, leaving its processes running without files they may still need. Please stop those processes before removing the fixture on platforms without /proc.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/cli/test/e2e/campaign-resume.test.ts
Line: 655-656
Comment:
**Detached campaign survives cleanup** If the workflow is still running when polling times out on macOS, `processesMentioning` returns no PIDs because `/proc` is absent. Cleanup then removes the fixture without stopping the detached campaign, leaving its processes running without files they may still need. Please stop those processes before removing the fixture on platforms without `/proc`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Collaborator
|
Thanks for the repro. Not merging this for now:
Also, a heads-up: "not a fix: #676" in the description matches GitHub's closing-keyword syntax ( |
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.
Refs #676. This adds a reproduction, not a fix: #676 is assigned to aviggiano, and this gives a fix a test to turn green.
What it adds
Stream-disconnect mode in the e2e stub
codex(packages/cli/test/e2e/campaign-resume.test.ts), off by default. For a named node's first N calls, the stub:exec --jsonwhen its provider stream drops and stays down: fiveReconnecting... n/5errors (stream_max_retriesdefaults to 5), the finalstream disconnected before completion: Transport error: network error: error decoding response body, andturn.failed;I captured that output from the real binary with an empty
CODEX_HOME, pointed at a local Responses endpoint that sendsresponse.createdand then destroys the socket.New e2e test, "a provider stream disconnect mid-node does not fail the node":
summarizemax_attempts: 1(the issue'sretries: 0) and drops its stream on the first call;RunFinishedwithsummarizesucceeded, which is Provider stream disconnects fail the node outright with no reconnect or resume #676's acceptance ("a regression test simulates a mid-stream disconnect and asserts the node completes");todo, so today's failure documents the bug without failing CI. A fix removes the marker.Refactor: the
initand config steps move intoinitializeCampaign, shared with the resume test. Process cleanup returns no processes where there is no/proc, so the new test also runs on macOS. The existing resume test still runs only on Linux.Reproduction result (local, macOS, pinned engine under Bun 1.3.14, about 8 minutes)
So a stream drop fails the node outright as a generic
executor-error. There's no transport-specific classification, which #676 also asks for.Follow-up
The stub now has two one-off modes (hold, stream drop). #1263 proposes turning it into a shared fixture where each test picks behaviors from a scenario file, for the other agent edge cases.
Cost
One more campaign in the e2e lane, about 8 minutes locally.
🤖 Generated with Claude Code
The PR appears safe to merge, but the new test should clean up unfinished detached campaigns on macOS.
Fix with agent prompt
Summary
The PR adds a Codex stream-disconnect simulation and a TODO end-to-end reproduction, while sharing campaign initialization with the existing resume test.
summarizeand records the current run failure without failing CI./procway to stop an unfinished campaign.Reviews (1) · Last reviewed commit: "test(cli): reproduce a provider stream d..."