Repository navigation
feat(cloud-agent-next): supervise native Kilo execution independently of Cloud turns - #7256
Conversation
… of Cloud turns Own Kilo execution activity and deadlines in per-process native session supervisors instead of deriving them from accepted Cloud messages. - Add session-supervisor, runtime-activity and session-snapshot: observe every session before route filtering, including unrouted, subagent and autonomous continuations; reconcile the global feed with a bounded snapshot and fence newer stream observations. - Change workspace_* no-progress to 20 minutes including silent running tools (user waits pause only that clock) and keep the separate 120-minute execution cap; abort the affected tree and settle accepted messages once, with bounded runtime recovery when cancellation is unconfirmed. - Reconcile deferred completed-message close evidence fenced by native runtime/execution and Cloud lastMessageId, and preserve attachment materialization across runtime replacement while retaining Stop and deadline cancellation. - Update the control-plane doc, cloud-agent AGENTS.md, and the session spec; extend wrapper, unit and E2E test coverage.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge All seven prior findings are resolved in the incremental range: snapshot-only sessions now start at Files Reviewed (10 files)
Previous Review Summary (commit 96b93a9)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 96b93a9)Status: 7 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (40 files)
Reviewed by deepseek-v4.1-flash · Input: 66.5K · Output: 22.2K · Cached: 1.2M Review guidance: REVIEW.md from base branch |
…rvision - Apply snapshot-only sessions even when other sessions emit events during the read, and keep a busy pre-cancellation snapshot from resurrecting a cancelled execution. - Cap message roles on the reconcile path and re-read only in-flight assistant messages in snapshots. - Do not fail a resubmitted turn with prompt_failed when a runtime restart cancels its retired in-flight dispatch. - Create the E2E evidence parent directory recursively, read the x-kilo-directory header in the SDK boundary test, and update the no_progress guidance in DEBUG.md.
- Merge overlapping turn and session supervisor cases without dropping assertions. - Reduce the pinned real-Kilo contracts from 11 to 9: drop retry-as-busy and merge the two child permission contracts. - Remove unused evidence capture from the real-Kilo activity fixture.
Summary
workspace_*execution is now supervised by per-process native sessionsupervisors instead of deriving activity and deadlines from accepted Cloud
messages. The sandbox stays alive while any Kilo session needs compute,
regardless of which chat the user views or whether Cloud Agent submitted the
current work, and a stuck native execution is interrupted with a specific
reason.
What changed
session-supervisor.ts,runtime-activity.ts,session-snapshot.ts): observe every session before route filtering,including unrouted sessions, subagents and autonomous continuations.
Reconcile the global feed with a bounded initial snapshot, single-flight on
reconnect and every 30 s, fencing newer stream observations.
workspace_*no-progress moves from 7 to 20 minutes andapplies to silent running tools too (user waits pause only that clock). The
separate 120-minute wall-clock cap remains. The supervisor aborts the
affected tree once, settles accepted messages with
no_progress/execution_limit, and uses bounded runtime recovery when cancellation isunconfirmed.
fenced by native runtime/execution and Cloud
lastMessageId, and preserveundispatched attachment materialization across runtime replacement while
retaining Stop and deadline cancellation.
docs/control-plane.md,AGENTS.md,.specs/cloud-agent-session.mdand the E2E README; add wrapper, unit and E2Ecoverage.
Verification
wrapper:tsgo --noEmitclean;bun test src-> 970 pass, 16 skip, 0 fail.cloud-agent-next:tsgo --noEmitclean;vitest run test/unit-> 1096 pass.oxlint-> 0 warnings, 0 errors..real.test.tscontracts need apinned Kilo CLI and are skipped in the default wrapper run.
format:checkreports 4 pre-existing drizzle snapshot JSONs untouched by this change.