sam 09ed7642c0 fix(daemon): detach terminal state transitions and cleanup from cancelled context
When an operator stopped a running task via chat /stop or the dashboard
Stop button, the task's context was cancelled. Container teardown
correctly completed (as Pool.Release detached its context), but terminal
state recording in Daemon.runViaAgent and worktree cleanup in
Daemon.cleanupTerminalTaskWorktree executed using the same cancelled
context. Consequently, SQLite transactions in store.Transition failed
immediately and errors were discarded, leaving the task row in 'running'
indefinitely until a daemon restart.

Extract parkRunningTask in internal/daemon/daemon.go to perform guarded
state transitions (store.StatusRunning -> store.StatusParked) using a
detached context (context.WithoutCancel) with a bounded 10-second timeout.
Update cleanupTerminalTaskWorktree to also use a detached 10-second
context for looking up the task status. Check transition errors and log
warnings for unexpected database failures while suppressing expected
ErrStaleTransition returns when workers have already completed. Add
comprehensive table-driven regression tests covering task cancellation,
worktree cleanup, and logging behavior.
2026-08-25 01:42:54 +10:00
S
Description
Archie connects events from your systems to agents that can investigate, reason, and act. Define what an event means, map its data into a workflow, and give that workflow an agent equipped for the job: its own execution environment, tools, and identity.
https://archie.catlow.cloud
Apache-2.0
133 MiB
0 Stars 1 Watchers 0 Forks
2026-11-10 10:01:23 +00:00
Languages
Go 76.8%
Vue 13.1%
TypeScript 7.8%
JavaScript 1.2%
Shell 0.6%
Other 0.4%