Bring conductor resume to flag parity with conductor run#158
Open
Bring conductor resume to flag parity with conductor run#158
conductor resume to flag parity with conductor run#158Conversation
Adds the run-only flags that are meaningful during resumed execution to
the resume command, fixing the broken UX where a workflow started with
`--web` or `--web-bg` could not be resumed with a dashboard.
New flags on resume:
- --provider / -p runtime provider override
- --metadata / -m CLI metadata merged on top of YAML metadata
- --web start a real-time web dashboard
- --web-port dashboard port (0 = auto-select)
- --web-bg fork a detached process running resume + dashboard
Intentionally not mirrored:
- --input restored from checkpoint context
- --workspace-instructions / --instructions
instructions_preamble persisted in checkpoint
- --dry-run incompatible with executing from a saved point
Implementation:
- resume_workflow_async() now wires up the same WorkflowEventEmitter,
EventLogSubscriber, ConsoleEventSubscriber, WebDashboard lifecycle,
and RunContext as run_workflow_async().
- Stop-signal handling refactored into shared _execute_with_stop_signal
used by both _run_with_stop_signal and the new _resume_with_stop_signal.
- New launch_background_resume() in bg_runner.py forks a detached
`conductor resume` subprocess with the dashboard and writes a PID
file so `conductor stop` can find it.
- AGENTS.md gains a Run / Resume Parity subsection (mirroring the
Provider Parity style) so future flag additions stay aligned.
Notes the dashboard caveat in the docstring: on resume, only events
from the resumed agent forward are shown. Events from agents that
completed before the checkpoint were emitted in the original process
and are not replayed.
Tests: 10 new cases covering provider/metadata pass-through,
--web flag handling, --web/--web-bg mutex, --web-bg dispatch to
launch_background_resume, malformed metadata rejection, and direct
unit tests of launch_background_resume command construction.
Verification: full suite (2382 passed / 9 skipped), lint clean,
format clean.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem
conductor resumewas missing several flags that exist onconductor run, making the recovery story confusing and broken in important cases. The most painful gap: a workflow started with--webor--web-bgcould not be resumed with a dashboard, so users lost visibility exactly when something had just gone wrong.What's added to
resume--provider/-p--metadata/-m--web--web-port--web-bg--weband--web-bgare mutually exclusive (matchingrun).Intentionally not mirrored
--input/-i--workspace-instructions,--instructionsinstructions_preambleis persisted in the checkpoint--dry-runImplementation notes
resume_workflow_async()now wires up the sameWorkflowEventEmitter,EventLogSubscriber,ConsoleEventSubscriber,WebDashboardlifecycle, andRunContextasrun_workflow_async()._execute_with_stop_signalhelper used by both_run_with_stop_signaland the new_resume_with_stop_signal.launch_background_resume()inbg_runner.pyforks a detachedconductor resumesubprocess and writes a PID file soconductor stopcan find it.Dashboard behavior on resume
Documented in the docstring: the dashboard only shows events from the resumed agent forward. Events from agents that completed before the checkpoint were emitted in the original process and are not replayed.
Future-proofing parity
Added a new Run / Resume Parity subsection to
AGENTS.md(mirroring the existing Provider Parity style) listing the parity rule, the flags that must stay aligned, and the flags intentionally skipped — so future contributors keep them in sync.Tests
10 new cases in
tests/test_cli/test_resume_command.py:--provider/-mflags pass through toresume_workflow_async--metadatais rejected--web+--web-portflags pass through--web+--web-bgmutex error--web-bgdispatches tolaunch_background_resumewith workflow path or--fromcheckpointlaunch_background_resumecommand construction (subcommand,--from, port, provider, metadata) andValueErrorwhen neitherworkflow_pathnorcheckpoint_pathis givenVerification
uv run ruff check src tests— cleanuv run ruff format --check src tests— cleanExample