Skip to content

fix(cloud-agent-next): control-plane recovery follow-ups - #5919

Merged
eshurakov merged 1 commit into
mainfrom
eshurakov/recovery-stack
Sep 8, 2026
Merged

fix(cloud-agent-next): control-plane recovery follow-ups#5919
eshurakov merged 1 commit into
mainfrom
eshurakov/recovery-stack

Conversation

@eshurakov

@eshurakov eshurakov commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up control-plane recovery fixes on top of the merged connection/receipt layer:
    • preserve native Stop cleanup proof
    • bound control message queues
    • recover exhausted SDK observation streams
    • skip preparation for warm legacy turns
    • preserve heartbeat reconnects
    • recover SDK streams after mutations
    • stop prune from retiring wrappers on leftover owned processes
    • document control-plane file log archives

Stack

Remaining control-plane recovery stack. #5912#5918 are merged. Merge from the bottom.

  1. fix(cloud-agent-next): control-plane recovery follow-ups #5919 eshurakov/recovery-stackmain
  2. fix(cloud-agent-next): release unadmitted queued messages on quarantine #5920 eshurakov/recovery-not-ready-retryeshurakov/recovery-stack
  3. fix(cloud-agent-next): recover cold attach after idle stop #5957 eshurakov/recovery-cold-bootstrap-attacheshurakov/recovery-not-ready-retry
  4. fix(web): keep Cloud Agent workspace tabs stable during progress #5958 eshurakov/ca-stable-workspace-tabseshurakov/recovery-cold-bootstrap-attach

Reviewer Notes

One commit. Unique vs main. Untracked plan docs in the worktree are not in this PR.

Comment thread services/cloud-agent-next/wrapper/src/utils.ts
Comment thread services/cloud-agent-next/wrapper/src/control/file-log-uploader.ts
@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

Incremental hardening guards slim live-user model updates, treats reasoning-without-time as non-streaming, ignores preparation progress after a terminal attempt, and skips occupancy assertions when unobservable; no new high-confidence issues.

Files Reviewed (4 files)
  • packages/cloud-agent-sdk/src/session-manager.test.ts
  • packages/cloud-agent-sdk/src/session-manager.ts
  • services/cloud-agent-next/src/session/preparation-progress.ts
  • services/cloud-agent-next/wrapper/src/control/owned-processes.test.ts
Previous Review Summaries (4 snapshots, latest commit 8e57273)

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

Previous review (commit 8e57273)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental occupancy-observability changes fix the leftover Linux wait when containment cannot observe descendants; no new high-confidence issues in the changed code.

Files Reviewed (3 files)
  • services/cloud-agent-next/wrapper/src/control/owned-processes.test.ts
  • services/cloud-agent-next/wrapper/src/control/owned-processes.ts
  • services/cloud-agent-next/wrapper/src/utils.ts

Previous review (commit 0147c5f)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

Linux runProcess can stall for the leftover git timeout after parent exit when occupancy cannot be observed, and control file-log uploads can leak tar processes on timeout.

Overview

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

WARNING

File Line Issue
services/cloud-agent-next/wrapper/src/utils.ts 323 Linux runProcess waits remaining timeoutMs when occupancy cannot be observed
services/cloud-agent-next/wrapper/src/control/file-log-uploader.ts 193 Timed-out archive collection does not kill tar
Files Reviewed (68 files)
  • .specs/cloud-agent-session.md
  • packages/cloud-agent-sdk/src/base-connection.ts
  • packages/cloud-agent-sdk/src/cloud-agent-transport-recovery.test.ts
  • packages/cloud-agent-sdk/src/cloud-agent-transport.ts
  • packages/cloud-agent-sdk/src/service-state.test.ts
  • packages/cloud-agent-sdk/src/service-state.ts
  • packages/cloud-agent-sdk/src/session-manager.test.ts
  • packages/cloud-agent-sdk/src/session-manager.ts
  • services/cloud-agent-next/DEBUG.md
  • services/cloud-agent-next/src/persistence/SandboxControl.ts
  • services/cloud-agent-next/src/router/handlers/session-management.ts
  • services/cloud-agent-next/src/router/handlers/session-queue.test.ts
  • services/cloud-agent-next/src/sandbox-control/diagnostics.test.ts
  • services/cloud-agent-next/src/sandbox-control/diagnostics.ts
  • services/cloud-agent-next/src/sandbox-control/lifecycle.test.ts
  • services/cloud-agent-next/src/sandbox-control/log-routes.test.ts
  • services/cloud-agent-next/src/sandbox-control/log-routes.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/control-event-receipts.test.ts
  • services/cloud-agent-next/src/sandbox-session/control-event-receipts.ts
  • services/cloud-agent-next/src/sandbox-session/control-plane-preparing.test.ts
  • services/cloud-agent-next/src/sandbox-session/control-plane-preparing.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/session-service.test.ts
  • services/cloud-agent-next/src/session-service.ts
  • services/cloud-agent-next/src/session/agent-runtime.test.ts
  • services/cloud-agent-next/src/session/agent-runtime.ts
  • services/cloud-agent-next/src/session/preparation-history.test.ts
  • services/cloud-agent-next/src/session/preparation-history.ts
  • services/cloud-agent-next/src/shared/control-diagnostics.test.ts
  • services/cloud-agent-next/src/shared/control-diagnostics.ts
  • services/cloud-agent-next/src/shared/sandbox-control-protocol.ts
  • services/cloud-agent-next/test/e2e/client.ts
  • services/cloud-agent-next/test/e2e/lifecycle.ts
  • services/cloud-agent-next/test/integration/sandbox-session-queue.test.ts
  • services/cloud-agent-next/test/unit/e2e/client.test.ts
  • services/cloud-agent-next/wrapper/src/control/apply-attach.test.ts
  • services/cloud-agent-next/wrapper/src/control/apply-attach.ts
  • services/cloud-agent-next/wrapper/src/control/control-event-ordering.test.ts
  • services/cloud-agent-next/wrapper/src/control/control-event-outbox.test.ts
  • services/cloud-agent-next/wrapper/src/control/control-event-outbox.ts
  • services/cloud-agent-next/wrapper/src/control/control-event-transport.test.ts
  • services/cloud-agent-next/wrapper/src/control/control-event-transport.ts
  • services/cloud-agent-next/wrapper/src/control/file-log-uploader.test.ts
  • services/cloud-agent-next/wrapper/src/control/file-log-uploader.ts - 1 issue
  • services/cloud-agent-next/wrapper/src/control/main.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/owned-processes.test.ts
  • services/cloud-agent-next/wrapper/src/control/owned-processes.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-runtime.test.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-runtime.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation-cleanup-proof.test.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation-cleanup.test.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation-cleanup.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation.ts
  • services/cloud-agent-next/wrapper/src/control/worktree-feed.test.ts
  • services/cloud-agent-next/wrapper/src/control/worktree-feed.ts
  • services/cloud-agent-next/wrapper/src/control/worktree-runtime.test.ts
  • services/cloud-agent-next/wrapper/src/kilo-api.test.ts
  • services/cloud-agent-next/wrapper/src/kilo-api.ts
  • services/cloud-agent-next/wrapper/src/log-uploader.ts
  • services/cloud-agent-next/wrapper/src/utils.ts - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit 359f140)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

Linux runProcess can stall for the leftover git timeout after parent exit when cgroup occupancy cannot be observed, and control file-log uploads can leak tar processes on timeout.

Overview

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

WARNING

File Line Issue
services/cloud-agent-next/wrapper/src/utils.ts 323 Linux runProcess waits remaining timeoutMs when occupancy cannot be observed
services/cloud-agent-next/wrapper/src/control/file-log-uploader.ts 193 Timed-out archive collection does not kill tar
Files Reviewed (43 files)
  • packages/cloud-agent-sdk/src/base-connection.ts
  • packages/cloud-agent-sdk/src/cloud-agent-transport-recovery.test.ts
  • packages/cloud-agent-sdk/src/cloud-agent-transport.ts
  • services/cloud-agent-next/DEBUG.md
  • services/cloud-agent-next/src/router/handlers/session-management.ts
  • services/cloud-agent-next/src/router/handlers/session-queue.test.ts
  • services/cloud-agent-next/src/sandbox-control/log-routes.test.ts
  • services/cloud-agent-next/src/sandbox-control/log-routes.ts
  • services/cloud-agent-next/src/sandbox-session/SandboxSession.ts
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.ts
  • services/cloud-agent-next/src/session-service.test.ts
  • services/cloud-agent-next/src/session-service.ts
  • services/cloud-agent-next/src/session/agent-runtime.test.ts
  • services/cloud-agent-next/src/session/agent-runtime.ts
  • services/cloud-agent-next/src/shared/control-diagnostics.test.ts
  • services/cloud-agent-next/src/shared/control-diagnostics.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/test/integration/sandbox-session-queue.test.ts
  • services/cloud-agent-next/wrapper/src/control/apply-attach.test.ts
  • services/cloud-agent-next/wrapper/src/control/apply-attach.ts
  • services/cloud-agent-next/wrapper/src/control/file-log-uploader.test.ts
  • services/cloud-agent-next/wrapper/src/control/file-log-uploader.ts - 1 issue
  • services/cloud-agent-next/wrapper/src/control/main.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/owned-processes.test.ts
  • services/cloud-agent-next/wrapper/src/control/owned-processes.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.test.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-runtime.test.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-runtime.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation-cleanup-proof.test.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation-cleanup.test.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation-cleanup.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation.test.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation.ts
  • services/cloud-agent-next/wrapper/src/control/worktree-feed.test.ts
  • services/cloud-agent-next/wrapper/src/control/worktree-feed.ts
  • services/cloud-agent-next/wrapper/src/control/worktree-runtime.test.ts
  • services/cloud-agent-next/wrapper/src/kilo-api.test.ts
  • services/cloud-agent-next/wrapper/src/kilo-api.ts
  • services/cloud-agent-next/wrapper/src/log-uploader.ts
  • services/cloud-agent-next/wrapper/src/utils.ts - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit d7e255f)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

Linux runProcess can stall for the leftover git timeout after parent exit when cgroup occupancy cannot be observed, and control file-log uploads can leak tar processes on timeout.

Overview

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

WARNING

File Line Issue
services/cloud-agent-next/wrapper/src/utils.ts 323 Linux runProcess waits remaining timeoutMs when occupancy cannot be observed
services/cloud-agent-next/wrapper/src/control/file-log-uploader.ts 193 Timed-out archive collection does not kill tar
Files Reviewed (43 files)
  • packages/cloud-agent-sdk/src/base-connection.ts
  • packages/cloud-agent-sdk/src/cloud-agent-transport-recovery.test.ts
  • packages/cloud-agent-sdk/src/cloud-agent-transport.ts
  • services/cloud-agent-next/DEBUG.md
  • services/cloud-agent-next/src/router/handlers/session-management.ts
  • services/cloud-agent-next/src/router/handlers/session-queue.test.ts
  • services/cloud-agent-next/src/sandbox-control/log-routes.test.ts
  • services/cloud-agent-next/src/sandbox-control/log-routes.ts
  • services/cloud-agent-next/src/sandbox-session/SandboxSession.ts
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.ts
  • services/cloud-agent-next/src/session-service.test.ts
  • services/cloud-agent-next/src/session-service.ts
  • services/cloud-agent-next/src/session/agent-runtime.test.ts
  • services/cloud-agent-next/src/session/agent-runtime.ts
  • services/cloud-agent-next/src/shared/control-diagnostics.test.ts
  • services/cloud-agent-next/src/shared/control-diagnostics.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/test/integration/sandbox-session-queue.test.ts
  • services/cloud-agent-next/wrapper/src/control/apply-attach.test.ts
  • services/cloud-agent-next/wrapper/src/control/apply-attach.ts
  • services/cloud-agent-next/wrapper/src/control/file-log-uploader.test.ts
  • services/cloud-agent-next/wrapper/src/control/file-log-uploader.ts - 1 issue
  • services/cloud-agent-next/wrapper/src/control/main.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/owned-processes.test.ts
  • services/cloud-agent-next/wrapper/src/control/owned-processes.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-handlers.test.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-runtime.test.ts
  • services/cloud-agent-next/wrapper/src/control/sandbox-control-runtime.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation-cleanup-proof.test.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation-cleanup.test.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation-cleanup.ts
  • services/cloud-agent-next/wrapper/src/control/session-operation.ts
  • services/cloud-agent-next/wrapper/src/control/worktree-feed.test.ts
  • services/cloud-agent-next/wrapper/src/control/worktree-feed.ts
  • services/cloud-agent-next/wrapper/src/control/worktree-runtime.test.ts
  • services/cloud-agent-next/wrapper/src/kilo-api.test.ts
  • services/cloud-agent-next/wrapper/src/kilo-api.ts
  • services/cloud-agent-next/wrapper/src/log-uploader.ts
  • services/cloud-agent-next/wrapper/src/utils.ts - 1 issue

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 127.2K · Output: 10.5K · Cached: 303.1K

Review guidance: REVIEW.md from base branch main

@eshurakov
eshurakov force-pushed the eshurakov/recovery-stack branch from d7e255f to 359f140 Compare September 6, 2026 18:02
Base automatically changed from eshurakov/recovery-control-connection to main September 7, 2026 13:39
@eshurakov
eshurakov force-pushed the eshurakov/recovery-stack branch 3 times, most recently from 8e57273 to 9218b0b Compare September 8, 2026 09:14
@eshurakov
eshurakov force-pushed the eshurakov/recovery-stack branch from 9218b0b to c3a60ae Compare September 8, 2026 09:25
@eshurakov
eshurakov merged commit 4049198 into main Sep 8, 2026
26 checks passed
@eshurakov
eshurakov deleted the eshurakov/recovery-stack branch September 8, 2026 10:15
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