You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
kimi web server process crashes with uncaught AbortError when pausing a goal with a queued continuation #2801
While using the web UI served by kimi web, pausing a goal on a session whose goal had a continuation in flight killed the entire server process:
Error [AbortError]: Goal continuation cancelled
at AgentGoalService.cancelPendingContinuation (...)
at AgentGoalService.applyLifecycle (...)
at AgentGoalService.pauseGoal (...)
at SessionLegacyService.applyAgentConfig (...)
at SessionLegacyService.updateProfile (...)
Node.js v24.x
The process exits; all other sessions served by the same daemon drop with it. Session data on disk is fine — only the server process dies.
Root cause
Two layers combine:
In packages/agent-core-v2/src/agent/goal/goalService.ts, launchContinuationTurn runs a bookkeeping promise chain (receipt.assigned.then(...).finally(...)) with no catch. When the pending continuation is aborted (pauseGoal → applyLifecycle → cancelPendingContinuation → receipt.abort(...)), that chain rejects with an AbortError and becomes an unhandled rejection.
In packages/telemetry/src/crash.ts, the unhandledRejection handler deliberately rethrows when it is the sole listener (print/server modes) to preserve Node's crash-on-rejection behavior — but it rethrows even for AbortError, which it otherwise classifies as expected cancellation noise and skips for tracking.
The same pause in the TUI survives because the TUI registers its own rejection handling; the daemon path has no such boundary.
Minimal reproduction
With the telemetry crash handlers installed and no other unhandledRejection listener (the daemon's shape):
installCrashHandlers();constabort=newError('Goal continuation cancelled');abort.name='AbortError';Promise.reject(abort);// unhandled, like the goal continuation bookkeeping chain
The process exits with throw reason from the rejection handler. With an early return for abort-shaped rejections, the process survives; non-abort rejections still crash as intended.
End-to-end: create a session via the web API, start a goal, let it reach a goal-driven continuation turn, then POST /api/v1/sessions/{id}/profile with {agent_config:{goal_control:pause}} — the daemon exits.
Suggested fix
Swallow the rejection in the continuation bookkeeping chain (it only cleans up bookkeeping state; real turn failures already surface via turn.ended events).
In the telemetry rejection handler, return early for AbortError instead of rethrowing it.
Happy to send a PR with both changes plus a regression test.
Activity
fix(telemetry): stop an aborted operation from escaping to a process …
feat: absorb the upstream commits after 2.0.0 and reconcile the test …