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
fix(runtime): emit LEASE_EXPIRED terminal on lease watchdog expiry (§9.5)
The lease watchdog used to emit a synthetic `tool_result.error` with a
fake `call_id` (`lease_{job_id}`) — that doesn't correspond to any
prior `tool_call`, so any subscriber correlating tool_call→tool_result
saw a dangling reference. Worse, after that it cancelled the job,
which routed the run-loop's `OperationCanceledException` catch to
`job.error{code:CANCELLED, final_status:"cancelled"}` rather than the
spec-required `LEASE_EXPIRED` / `final_status:"error"`.
- Add `Job.MarkLeaseExpired()` / `Job.LeaseExpired` analogous to the
existing `MarkRuntimeLimitExceeded`.
- Have `RunLeaseWatchdog` emit a `status{phase:"lease_expired"}` event
(well-known phase added to `StatusPhases`), set the flag, then
cancel.
- Branch the run-loop's `OperationCanceledException` catch on the flag
and emit `job.error{LEASE_EXPIRED, final_status:"error",
retryable:false}`.
- Update the LeaseExpiresAt sample header comment to match what the
runtime now delivers.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments