mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-03-16 18:33:08 +00:00
fix: handle pausing/draining states in UI guards and process cleanup
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>
This commit is contained in:
@@ -210,8 +210,8 @@ function App() {
|
||||
setShowKeyboardHelp(true)
|
||||
}
|
||||
|
||||
// R : Open reset modal (when project selected and agent not running)
|
||||
if ((e.key === 'r' || e.key === 'R') && selectedProject && wsState.agentStatus !== 'running') {
|
||||
// R : Open reset modal (when project selected and agent not running/draining)
|
||||
if ((e.key === 'r' || e.key === 'R') && selectedProject && !['running', 'pausing', 'paused_graceful'].includes(wsState.agentStatus)) {
|
||||
e.preventDefault()
|
||||
setShowResetModal(true)
|
||||
}
|
||||
@@ -380,7 +380,7 @@ function App() {
|
||||
variant="outline"
|
||||
size="sm"
|
||||
aria-label="Reset Project"
|
||||
disabled={wsState.agentStatus === 'running'}
|
||||
disabled={['running', 'pausing', 'paused_graceful'].includes(wsState.agentStatus)}
|
||||
>
|
||||
<RotateCcw size={18} />
|
||||
</Button>
|
||||
|
||||
@@ -72,9 +72,13 @@ export function AgentMissionControl({
|
||||
? `${agents.length} ${agents.length === 1 ? 'agent' : 'agents'} active`
|
||||
: orchestratorStatus?.state === 'initializing'
|
||||
? 'Initializing'
|
||||
: orchestratorStatus?.state === 'complete'
|
||||
? 'Complete'
|
||||
: 'Orchestrating'
|
||||
: orchestratorStatus?.state === 'draining'
|
||||
? 'Draining'
|
||||
: orchestratorStatus?.state === 'paused'
|
||||
? 'Paused'
|
||||
: orchestratorStatus?.state === 'complete'
|
||||
? 'Complete'
|
||||
: 'Orchestrating'
|
||||
}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
@@ -63,7 +63,7 @@ export function AgentThought({ logs, agentStatus }: AgentThoughtProps) {
|
||||
// Determine if component should be visible
|
||||
const shouldShow = useMemo(() => {
|
||||
if (!thought) return false
|
||||
if (agentStatus === 'running') return true
|
||||
if (agentStatus === 'running' || agentStatus === 'pausing') return true
|
||||
if (agentStatus === 'paused') {
|
||||
return Date.now() - lastLogTimestamp < IDLE_TIMEOUT
|
||||
}
|
||||
|
||||
@@ -103,6 +103,10 @@ function getStateAnimation(state: OrchestratorState): string {
|
||||
return 'animate-working'
|
||||
case 'monitoring':
|
||||
return 'animate-bounce-gentle'
|
||||
case 'draining':
|
||||
return 'animate-thinking'
|
||||
case 'paused':
|
||||
return ''
|
||||
case 'complete':
|
||||
return 'animate-celebrate'
|
||||
default:
|
||||
@@ -121,6 +125,10 @@ function getStateGlow(state: OrchestratorState): string {
|
||||
return 'shadow-[0_0_16px_rgba(124,58,237,0.6)]'
|
||||
case 'monitoring':
|
||||
return 'shadow-[0_0_8px_rgba(167,139,250,0.4)]'
|
||||
case 'draining':
|
||||
return 'shadow-[0_0_10px_rgba(251,191,36,0.5)]'
|
||||
case 'paused':
|
||||
return ''
|
||||
case 'complete':
|
||||
return 'shadow-[0_0_20px_rgba(112,224,0,0.6)]'
|
||||
default:
|
||||
@@ -141,6 +149,10 @@ function getStateDescription(state: OrchestratorState): string {
|
||||
return 'spawning agents'
|
||||
case 'monitoring':
|
||||
return 'monitoring progress'
|
||||
case 'draining':
|
||||
return 'draining active agents'
|
||||
case 'paused':
|
||||
return 'paused'
|
||||
case 'complete':
|
||||
return 'all features complete'
|
||||
default:
|
||||
|
||||
@@ -55,7 +55,7 @@ export function ProgressDashboard({
|
||||
|
||||
const showThought = useMemo(() => {
|
||||
if (!thought) return false
|
||||
if (agentStatus === 'running') return true
|
||||
if (agentStatus === 'running' || agentStatus === 'pausing') return true
|
||||
if (agentStatus === 'paused') {
|
||||
return Date.now() - lastLogTimestamp < IDLE_TIMEOUT
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user