Skip to content

feat(cloud-agent-next): coordinate scoped Stop requests - #5914

Merged
eshurakov merged 1 commit into
eshurakov/recovery-resultsfrom
eshurakov/recovery-stop-scope
Sep 7, 2026
Merged

feat(cloud-agent-next): coordinate scoped Stop requests#5914
eshurakov merged 1 commit into
eshurakov/recovery-resultsfrom
eshurakov/recovery-stop-scope

Conversation

@eshurakov

@eshurakov eshurakov commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Coordinate Stop against a scoped runtime/operation rather than a process-wide interrupt.
  • Keep Stop immutable once admitted and preserve original-result/ACK behavior from earlier layers.

Stack

Control-plane recovery stack. Merge from the bottom. Each PR targets its parent, not main (except #5912).

  1. fix(cloud-agent-next): isolate observation from liveness #5912 eshurakov/recovery-observationmain
  2. feat(cloud-agent-next): retain session operation results #5913 eshurakov/recovery-resultseshurakov/recovery-observation
  3. feat(cloud-agent-next): coordinate scoped Stop requests #5914 eshurakov/recovery-stop-scopeeshurakov/recovery-results
  4. fix(cloud-agent-next): retire native runtimes safely #5915 eshurakov/recovery-native-cleanupeshurakov/recovery-stop-scope
  5. fix(cloud-agent-next): preserve cleanup retirement target #5916 eshurakov/recovery-session-deliveryeshurakov/recovery-native-cleanup
  6. fix(cloud-agent-next): recover and bound native event feeds #5917 eshurakov/recovery-native-feedeshurakov/recovery-session-delivery
  7. feat(cloud-agent-next): recover control connections with event receipts #5918 eshurakov/recovery-control-connectioneshurakov/recovery-native-feed
  8. fix(cloud-agent-next): control-plane recovery follow-ups #5919 eshurakov/recovery-stackeshurakov/recovery-control-connection
  9. fix(cloud-agent-next): release unadmitted queued messages on quarantine #5920 eshurakov/recovery-not-ready-retryeshurakov/recovery-stack

Do not merge out of order.

Reviewer Notes

One commit. Unique vs parent.

@kilo-code-bot

kilo-code-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Full review of scoped Stop coordination on rewritten HEAD bce05180 found no high-confidence correctness, security, or runtime issues.

Files Reviewed (32 files)
  • services/cloud-agent-next/src/kilo-facade/user-kilo-facade.ts
  • services/cloud-agent-next/src/persistence/SandboxControl.ts
  • services/cloud-agent-next/src/router.test.ts
  • services/cloud-agent-next/src/router/control-plane-session.test.ts
  • services/cloud-agent-next/src/router/control-plane-session.ts
  • services/cloud-agent-next/src/router/handlers/session-management.ts
  • services/cloud-agent-next/src/sandbox-control/frames.test.ts
  • services/cloud-agent-next/src/sandbox-control/frames.ts
  • services/cloud-agent-next/src/sandbox-control/lifecycle.test.ts
  • services/cloud-agent-next/src/sandbox-control/scoped-stop-maintenance.test.ts
  • services/cloud-agent-next/src/sandbox-control/scoped-stop-maintenance.ts
  • services/cloud-agent-next/src/sandbox-control/socket.test.ts
  • services/cloud-agent-next/src/sandbox-control/socket.ts
  • services/cloud-agent-next/src/sandbox-session/SandboxSession.ts
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.test.ts
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.ts
  • services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.test.ts
  • services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.ts
  • services/cloud-agent-next/src/sandbox-session/session-stop-progress.test.ts
  • services/cloud-agent-next/src/sandbox-session/session-stop-progress.ts
  • services/cloud-agent-next/src/sandbox-session/session-stop.test.ts
  • services/cloud-agent-next/src/sandbox-session/session-stop.ts
  • services/cloud-agent-next/src/shared/control-plane-session.ts
  • services/cloud-agent-next/src/shared/sandbox-control-protocol.ts
  • services/cloud-agent-next/test/integration/sandbox-control.test.ts
  • services/cloud-agent-next/wrapper/src/control/operation-registry.test.ts
  • services/cloud-agent-next/wrapper/src/control/operation-registry.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-client.test.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-client.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.test.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation.ts
Previous Review Summaries (3 snapshots, latest commit 191aa9d)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 191aa9d)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 4
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
services/cloud-agent-next/src/sandbox-session/session-stop.ts 91 Worker-stamped cleanup deadline fails closed on 1ms Session DO clock skew
services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.ts 28 Unconfirmed Stop receipts are persisted then immediately pruned
services/cloud-agent-next/wrapper/src/control/operation-registry.ts 193 abortTarget can return a retained attach receipt instead of the prompt
services/cloud-agent-next/src/sandbox-control/scoped-stop-maintenance.ts 12 Already-admitted Stop aborts fail closed on SandboxControl clock recap
Files Reviewed (32 files)
  • services/cloud-agent-next/src/kilo-facade/user-kilo-facade.ts - 0 issues
  • services/cloud-agent-next/src/persistence/SandboxControl.ts - 0 issues
  • services/cloud-agent-next/src/router.test.ts - 0 issues
  • services/cloud-agent-next/src/router/control-plane-session.test.ts - 0 issues
  • services/cloud-agent-next/src/router/control-plane-session.ts - 0 issues
  • services/cloud-agent-next/src/router/handlers/session-management.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/frames.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/frames.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/lifecycle.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/scoped-stop-maintenance.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/scoped-stop-maintenance.ts - 1 issue
  • services/cloud-agent-next/src/sandbox-control/socket.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/socket.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/SandboxSession.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.ts - 1 issue
  • services/cloud-agent-next/src/sandbox-session/session-stop-progress.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop-progress.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop.ts - 1 issue
  • services/cloud-agent-next/src/shared/control-plane-session.ts - 0 issues
  • services/cloud-agent-next/src/shared/sandbox-control-protocol.ts - 0 issues
  • services/cloud-agent-next/test/integration/sandbox-control.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/operation-registry.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/operation-registry.ts - 1 issue
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-client.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-client.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/session-operation.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit ede7e1f)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
services/cloud-agent-next/src/sandbox-session/session-stop.ts 91 Worker-stamped cleanup deadline fails closed on 1ms Session DO clock skew
services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.ts 28 Unconfirmed Stop receipts are persisted then immediately pruned
services/cloud-agent-next/wrapper/src/control/operation-registry.ts 193 abortTarget can return a retained attach receipt instead of the prompt
Files Reviewed (32 files)
  • services/cloud-agent-next/src/kilo-facade/user-kilo-facade.ts - 0 issues
  • services/cloud-agent-next/src/persistence/SandboxControl.ts - 0 issues
  • services/cloud-agent-next/src/router.test.ts - 0 issues
  • services/cloud-agent-next/src/router/control-plane-session.test.ts - 0 issues
  • services/cloud-agent-next/src/router/control-plane-session.ts - 0 issues
  • services/cloud-agent-next/src/router/handlers/session-management.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/frames.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/frames.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/lifecycle.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/scoped-stop-maintenance.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/scoped-stop-maintenance.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/socket.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/socket.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/SandboxSession.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.ts - 1 issue
  • services/cloud-agent-next/src/sandbox-session/session-stop-progress.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop-progress.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop.ts - 1 issue
  • services/cloud-agent-next/src/shared/control-plane-session.ts - 0 issues
  • services/cloud-agent-next/src/shared/sandbox-control-protocol.ts - 0 issues
  • services/cloud-agent-next/test/integration/sandbox-control.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/operation-registry.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/operation-registry.ts - 1 issue
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-client.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-client.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/session-operation.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 6c96c71)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
services/cloud-agent-next/src/sandbox-session/session-stop.ts 91 Worker-stamped cleanup deadline fails closed on 1ms Session DO clock skew
services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.ts 28 Unconfirmed Stop receipts are persisted then immediately pruned
services/cloud-agent-next/wrapper/src/control/operation-registry.ts 193 abortTarget can return a retained attach receipt instead of the prompt
Files Reviewed (32 files)
  • services/cloud-agent-next/src/kilo-facade/user-kilo-facade.ts - 0 issues
  • services/cloud-agent-next/src/persistence/SandboxControl.ts - 0 issues
  • services/cloud-agent-next/src/router.test.ts - 0 issues
  • services/cloud-agent-next/src/router/control-plane-session.test.ts - 0 issues
  • services/cloud-agent-next/src/router/control-plane-session.ts - 0 issues
  • services/cloud-agent-next/src/router/handlers/session-management.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/frames.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/frames.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/lifecycle.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/scoped-stop-maintenance.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/scoped-stop-maintenance.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/socket.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/socket.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/SandboxSession.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop-lifecycle.ts - 1 issue
  • services/cloud-agent-next/src/sandbox-session/session-stop-progress.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop-progress.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-session/session-stop.ts - 1 issue
  • services/cloud-agent-next/src/shared/control-plane-session.ts - 0 issues
  • services/cloud-agent-next/src/shared/sandbox-control-protocol.ts - 0 issues
  • services/cloud-agent-next/test/integration/sandbox-control.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/operation-registry.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/operation-registry.ts - 1 issue
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-client.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-client.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.test.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.ts - 0 issues
  • services/cloud-agent-next/wrapper/src/control/session-operation.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 108.4K · Output: 20.8K · Cached: 1.1M

Review guidance: REVIEW.md from base branch eshurakov/recovery-results

@eshurakov
eshurakov force-pushed the eshurakov/recovery-stop-scope branch from 6c96c71 to ede7e1f Compare September 7, 2026 08:36
@eshurakov
eshurakov force-pushed the eshurakov/recovery-stop-scope branch from ede7e1f to 191aa9d Compare September 7, 2026 09:34

@iscekic iscekic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eshurakov
eshurakov force-pushed the eshurakov/recovery-stop-scope branch from 191aa9d to bce0518 Compare September 7, 2026 12:49
@eshurakov

Copy link
Copy Markdown
Contributor Author

Kilobot warnings checked after the parent rewrite.

Valid:

  • Unconfirmed Stop receipts were persisted at the cleanup bound and then pruned on the next compact. Compact now keeps them through the deadline tick.
  • abortTarget could return a retained attach with the same messageId as the prompt. It now prefers the execution receipt.

Theoretical / not changed:

  • 1ms Worker vs Session clock skew on the 10s cleanup window. Fresh stamps are now+10s; 1ms cannot trip <= now.
  • Same window recap on SandboxControl after Session admit. Abort RPC moves Control now forward; 1ms recap is not shown.

@eshurakov
eshurakov merged commit 58803c7 into main Sep 7, 2026
17 checks passed
@eshurakov
eshurakov deleted the eshurakov/recovery-stop-scope branch September 7, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants