Skip to content

Commit 476da47

Browse files
committed
fix(workflows): change pause behavior to match user expectations
Previously, pressing pause in auto mode only switched to manual mode, requiring a second press to actually pause. Now it performs both actions in one step to align with user expectations of immediate pausing.
1 parent 31a5dc3 commit 476da47

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/workflows/signals/handlers/pause.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,16 @@ export async function handlePauseSignal(ctx: SignalContext): Promise<void> {
4242
return;
4343
}
4444

45-
// If in auto mode (running state), just switch to manual mode (don't set paused state)
46-
// This allows user to re-enable auto mode without being blocked by paused state
45+
// If in auto mode, switch to manual mode AND pause in one action
46+
// Users expect 'p' to pause immediately, not require two presses
4747
const wasAutoMode = ctx.mode.autoMode;
4848
if (wasAutoMode) {
49-
debug('[PauseSignal] Switching from auto to manual mode');
49+
debug('[PauseSignal] Switching from auto to manual mode and pausing');
5050
// Persist to file first - this emits workflow:mode-change event
51-
// Controller listens for this and aborts itself with switchToManual=true,
52-
// returning __SWITCH_TO_MANUAL__ instead of stopping the workflow
51+
// Controller listens for this and aborts itself with switchToManual=true
5352
await setAutonomousMode(ctx.cmRoot, false);
5453
ctx.mode.disableAutoMode();
55-
// Don't set paused state - we're just switching modes, not pausing
56-
debug('[PauseSignal] Auto mode disabled, returning');
57-
return;
54+
// Continue to pause logic below (don't return early)
5855
}
5956

6057
if (ctx.machine.state === 'running' || ctx.machine.state === 'delegated') {

0 commit comments

Comments
 (0)