Skip to content

feat(cli): add conductor stop command for background workflows#12

Merged
jrob5756 merged 1 commit intomainfrom
feat/conductor-stop-command
Mar 3, 2026
Merged

feat(cli): add conductor stop command for background workflows#12
jrob5756 merged 1 commit intomainfrom
feat/conductor-stop-command

Conversation

@jrob5756
Copy link
Copy Markdown
Collaborator

@jrob5756 jrob5756 commented Mar 3, 2026

Summary

  • Add conductor stop CLI command to manage background workflow processes launched with --web-bg
  • Add PID file tracking (~/.conductor/runs/) so background processes can be discovered and stopped
  • Add stop button to web dashboard UI that cancels the running workflow
  • Add POST /api/stop endpoint that races against the workflow engine to actually cancel execution

Details

Previously, stopping a background workflow required manually finding and killing the process (kill $(lsof -ti:PORT)). Now:

  • conductor stop — auto-stops if one running, lists if multiple
  • conductor stop --port 8080 — stop specific port
  • conductor stop --all — stop all background workflows
  • Dashboard stop button — visible when workflow is running, cancels via /api/stop

PID files are written on --web-bg launch and cleaned up on natural completion or explicit stop.

Test plan

  • 13 tests for PID file utilities (test_pid.py)
  • 7 tests for stop CLI command (test_stop.py)
  • 5 tests for /api/stop endpoint and stop signal (test_server.py)
  • All 1567 existing tests pass
  • make lint and make typecheck pass

🤖 Generated with Claude Code

Add PID file tracking and a `stop` CLI command to manage background
workflow processes launched with `--web-bg`. Previously, stopping a
background workflow required manually finding and killing the process.

- Add `pid.py` with PID file read/write/cleanup utilities (~/.conductor/runs/)
- Write PID file in `bg_runner.py` after background launch succeeds
- Clean up PID file on natural child process exit in `run.py`
- Add `conductor stop` command with `--port` and `--all` options
- Add `POST /api/stop` endpoint to web dashboard server
- Add stop button to web dashboard header (visible when workflow is running)
- Race engine.run() against dashboard stop signal so stop actually cancels the workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jrob5756 jrob5756 merged commit d7599a1 into main Mar 3, 2026
5 of 6 checks passed
@jrob5756 jrob5756 deleted the feat/conductor-stop-command branch March 3, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant