Skip to content

fix(chat): stop active runs and background processes immediately - #281

Open
24baigei wants to merge 2 commits into
Stack-Cairn:mainfrom
24baigei:fix/chat-stop-background-tasks
Open

fix(chat): stop active runs and background processes immediately#281
24baigei wants to merge 2 commits into
Stack-Cairn:mainfrom
24baigei:fix/chat-stop-background-tasks

Conversation

@24baigei

Copy link
Copy Markdown
Contributor

Summary

  • Make Stop update GUI and Gateway WebUI state immediately instead of waiting for the active turn to unwind.
  • Bind abort controllers, runtime state, transcript/tool status, compaction state, snapshots, and timers to the exact run so stale finalizers cannot overwrite a newer turn.
  • Prevent stopped turns from advancing the queue or being revived by late cancelling, hydration, or replay events.
  • Propagate the user-stop signal across parent/child agents and terminate non-isolated managed process trees.
  • Preserve existing isolated=true long-running process behavior.

Cross-platform behavior

  • macOS/Linux: terminate the managed Unix process group with TERM, followed by KILL when needed.
  • Windows: terminate the full process tree with taskkill /T /F.
  • GUI and Gateway WebUI share the same immediate-stop and stale-run protections.
  • The Unix process-group path could not be exercised on the Windows development host and should be confirmed by macOS/Linux CI.

Verification

  • 36/36 targeted GUI tests passed.
  • 120/120 targeted Gateway/WebUI tests passed.
  • GUI and WebUI TypeScript checks passed.
  • GUI and WebUI production builds passed.
  • git diff --check passed.
  • Biome lint passed with formatter disabled; only pre-existing repository warnings were reported.

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