Skip to content

feat: add graceful pause (drain mode) for running agents#183

Merged
leonvanzyl merged 1 commit intoAutoForgeAI:masterfrom
CaitlynByrne:feat/pause-drain
Feb 12, 2026
Merged

feat: add graceful pause (drain mode) for running agents#183
leonvanzyl merged 1 commit intoAutoForgeAI:masterfrom
CaitlynByrne:feat/pause-drain

Conversation

@CaitlynByrne
Copy link
Copy Markdown
Contributor

Summary

  • File-based signal (.pause_drain) lets the orchestrator finish current work before pausing instead of hard-freezing the process tree
  • New status states pausing / paused_graceful flow through WebSocket to the UI
  • UI adds a Pause button, draining indicator, and Resume button

Changes

  • parallel_orchestrator.py — detect .pause_drain signal file, drain gracefully
  • server/services/process_manager.py — new pause/resume endpoints and status management
  • server/routers/agent.py — REST API for pause/resume
  • autoforge_paths.py — path constant for .pause_drain signal file
  • UI: AgentControl.tsx — pause button with draining state, OrchestratorStatusCard.tsx — status display
  • WebSocket and type definitions updated for new statuses

Test plan

  • Start a parallel agent run and click Pause — verify agents finish current feature before stopping
  • Confirm UI shows "draining" indicator while agents wind down
  • Click Resume and verify agents pick back up
  • Verify .pause_drain file is created on pause and removed on resume
  • Test that hard stop still works while in paused/draining state

🤖 Generated with Claude Code

File-based signal (.pause_drain) lets the orchestrator finish current
work before pausing instead of hard-freezing the process tree.  New
status states pausing/paused_graceful flow through WebSocket to the UI
where a Pause button, draining indicator, and Resume button are shown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@leonvanzyl leonvanzyl merged commit c114248 into AutoForgeAI:master Feb 12, 2026
@leonvanzyl
Copy link
Copy Markdown
Collaborator

Thanks for this! Merged and will fix a few edge-case issues as follow-up (drain signal cleanup, UI guards during pausing/draining states).

leonvanzyl added a commit that referenced this pull request Feb 12, 2026
Follow-up fixes after merging PR #183 (graceful pause/drain mode):

- process_manager: _stream_output finally block now transitions from
  pausing/paused_graceful to crashed/stopped (not just running), and
  cleans up the drain signal file on process exit
- App.tsx: block Reset button and R shortcut during pausing/paused_graceful
- AgentThought/ProgressDashboard: keep thought bubble visible while pausing
- OrchestratorAvatar: add draining/paused cases to animation, glow, and
  description switch statements
- AgentMissionControl: show Draining/Paused badge text for new states
- registry.py: remove redundant type annotation to fix mypy no-redef
- process_manager.py: add type:ignore for SQLAlchemy Column assignment
- websocket.py: reclassify test-pass lines as 'testing' not 'success'
- review-pr.md: add post-review recommended action guidance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants