Daemon creates a root context, cancelled on SIGTERM. Sessions derive their context from it. Agent turns derive from session ctx. Tools get the turn ctx. Signal propagation: - SIGTERM → daemonCancel() → all session ctxs cancelled → agent turns exit - User interrupt → agent.Interrupt() (SIGINT equivalent, turn-level only) - Session kill → sess.Cancel() → that session's agents stop Previously sessions used context.Background() — daemon shutdown had no automatic propagation to running agents. |
||
|---|---|---|
| .. | ||
| create.go | ||
| format.go | ||
| manager.go | ||
| persist.go | ||
| session.go | ||
| sessionfile.go | ||