Repository navigation
fix(mothership): settle a sim_cli wait that outlasted --wait-timeout as done, not failed - #9469
Merged
Merged
Conversation
…as done, not failed A wait whose --wait-timeout elapsed with the work still going (workflows runs wait, a detached synchronous workflows run, a workspace operation wait) exits 4 and prints the record to continue from. The sim_cli handler mapped every non-zero exit to a failed call, so each still-running slice the worker issues for a long draft run was recorded as a failed async tool call, published to the chat as an errored row (titled 'Running workflow' / 'Waiting for workflow run' instead of the past tense, and dropping the activity's completed title), and counted as outcome=error in copilot.tool.calls. The CLI now names that status (STILL_RUNNING_EXIT_CODE, exported from sim/embed) at both producers, and the handler settles it as success while keeping exitCode 4 in the output the worker branches on.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge. SummaryThis PR treats an expired
No actionable issues were found. Tests were inspected but not run. Reviews (1) · Last reviewed commit: "fix(mothership): settle a sim_cli wait t..." · Reviewed by Greptile |
This was referenced Oct 30, 2026
waleedlatif1
added a commit
that referenced
this pull request
Oct 30, 2026
…l controller (#9475) * test(mothership): drive a draft run past a wait slice through the real controller A live case for the worker's sliced synchronous `workflows run` (#9464, #9469): a draft with Wait blocks totalling 500 s runs through runCopilotLifecycle, the sim_cli handler, the embedded CLI and the v2 execute and runs routes against the worker's scripted draft-run probe. With workflow-run-wait-timeout declared it checks the detached first slice, the `workflows runs wait` slices, the output read-back, that no call holds the run and no slice row is failed, and that the model receives the run's output. Without the capability it checks one held call as before, and a model's own --wait-timeout 5 reaches the model as exit 4 with the running receipt. The controller fixture now pins direct Sim transport, since self-hosted defaults to checkpoint delivery and its run control went unanswered, and the fixture plan's execution timeout is per case so a run can outlast a slice. * test(mothership): keep the draft-run case inside the repo's audits Uses sleep from @sim/utils/helpers, guards the last wait slice instead of a non-null assertion, gives the probe's startup its own ten-second deadline like the neighbouring controller case, and tells knip the probe path lives in the worker checkout.
This branch was previously deployed
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
A
sim_cliwait whose--wait-timeoutelapsed while the work keeps going exits 4 and prints the record to continue from. That coversworkflows runs wait, a synchronousworkflows runthat detached (#9464), and a workspace operation wait. Thesim_clihandler treated every non-zero exit as a failed call. So when the worker runs a long draft workflow test run in slices, each still-running slice got:copilot_async_tool_callsasfailed, with the "still running" stderr line as its erroroutcome=errorincopilot.tool.calls, with the tool span ended aserrorThe CLI now names that exit status (
STILL_RUNNING_EXIT_CODE, exported fromsim/embed) at both places that produce it. The handler settles it as a successful call and keepsexitCode: 4in the output, which is what the worker branches on to issue the next slice. Every other non-zero exit is still a failed call, including 1 (the run failed), 2 (cancelled) and 3 (paused).Type of Change
Testing
sim-cli-bridge.test.ts: an exit-4 wait settles as{ success: true, output: { exitCode: 4, … } }. It fails on the pre-fix handler (success: falsewith the stderr line aserror).executeToolAndReportwith a throwaway probe: async rowfailed, client tool eventstatus: error, metricoutcome: error. The UI helpers gave "Running workflow" and "Waiting for workflow run" for errored rows, and a group header of "Get run" instead of "Tested the draft workflow".bun run lint,type-check(sim, sim-cli),check:audits, and the vitest suites forlib/mothership/agent-cli, the handler andsim-clicommands/protocolall pass.Checklist