Skip to content

LOST-WORKSPACE: disable control snapshots and restore control commit path - #6622

Merged
eshurakov merged 1 commit into
mainfrom
triage/lost-workspace
Sep 23, 2026
Merged

eshurakov merged 1 commit into
mainfrom
triage/lost-workspace

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • The control-plane Kilo config now sets snapshot: false (buildWorktreeKiloEnvironment, services/cloud-agent-next/wrapper/src/control/worktree-runtime.ts), matching the legacy builder's intent that no Cloud Agent session runs Kilo's snapshot feature.
  • The SandboxSession admission default no longer requires a worktree, so a control session without one defaults per-turn autoCommit to true and its work is committed (and pushed when a remote is reachable) at successful turn completion.
  • Why: a control session with no worktree had no durable home for its work. On a container recycle its worktree is re-minted and the uncommitted work was lost.

Tests

  • A Bun snapshot assertion, new and strengthened Vitest cases, and Worker-runtime contract expectations.
  • Verified locally on a real stack.

Base branch: triage/attach-reclaim.

finalization: {
...metadata.finalization,
...input.finalization,
autoCommit: input.finalization?.autoCommit ?? metadata.finalization?.autoCommit ?? true,

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.

SUGGESTION: The new auto-commit default is applied only at admission, not when legacy queued messages are frozen.

This default now covers non-worktree control sessions at admission, but the three sibling sites that freeze legacy queued rows still gate the default finalization on a worktree: latestMetadata.workspace?.worktreeId ? latestMetadata.finalization : undefined at lines 3489 and 3535, and metadata.workspace?.worktreeId ? metadata.finalization : undefined at line 3613. A legacy queued row in a non-worktree control session is therefore frozen with no finalization, and the wrapper falls back to autoCommit ?? false (services/cloud-agent-next/wrapper/src/server.ts:540), so that turn still never commits — the same lost-work gap this PR closes for newly admitted messages. The updated integration expectation at test/integration/sandbox-control.test.ts:11510 documents this asymmetry (frozen legacy intents have no finalization, while msg_new_b gets autoCommit: true). Consider supplying the same default in those freeze paths for consistency.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The rebased PR content is unchanged from the prior review; the control-session auto-commit default is applied only at admission, while legacy queued rows frozen later in non-worktree sessions still bypass it, leaving a residual lost-work path.

Overview

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

SUGGESTION

File Line Issue
services/cloud-agent-next/src/sandbox-session/SandboxSession.ts 3399 New default is applied only at admission; the legacy-freeze sites (SandboxSession.ts:3497, :3543, :3621) still gate default finalization on a worktree, so frozen legacy rows in non-worktree control sessions still get no autoCommit.
Files Reviewed (5 files)
  • services/cloud-agent-next/src/sandbox-session/SandboxSession.ts - 1 issue
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.test.ts - no issues
  • services/cloud-agent-next/test/integration/sandbox-control.test.ts - no issues
  • services/cloud-agent-next/wrapper/src/control/worktree-runtime.ts - no issues
  • services/cloud-agent-next/wrapper/src/control/worktree-runtime.test.ts - no issues

Fix these issues in Kilo Cloud

Previous Review Summary (commit 4224829)

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

Previous review (commit 4224829)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The control-session auto-commit default is correct at admission, but legacy queued rows frozen later in non-worktree sessions still bypass it, leaving a residual lost-work path.

Overview

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

SUGGESTION

File Line Issue
services/cloud-agent-next/src/sandbox-session/SandboxSession.ts 3391 New default is applied only at admission; the legacy-freeze sites (3489/3535/3613) still gate default finalization on a worktree, so frozen legacy rows in non-worktree control sessions still get no autoCommit.
Files Reviewed (5 files)
  • services/cloud-agent-next/src/sandbox-session/SandboxSession.ts - 1 issue
  • services/cloud-agent-next/src/sandbox-session/session-message-queue.test.ts - no issues
  • services/cloud-agent-next/test/integration/sandbox-control.test.ts - no issues
  • services/cloud-agent-next/wrapper/src/control/worktree-runtime.ts - no issues
  • services/cloud-agent-next/wrapper/src/control/worktree-runtime.test.ts - no issues

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

@eshurakov
eshurakov added this pull request to stack #6628 September 23, 2026 07:20
Base automatically changed from triage/attach-reclaim to main September 23, 2026 07:38
…commit path

The control-plane Kilo config now sets snapshot: false, matching the legacy
builder's intent that no Cloud Agent session runs Kilo's snapshot feature.

The SandboxSession admission gate no longer requires a worktree: a control
session without one now defaults per-turn autoCommit to true, so its work is
committed (and pushed when a remote is reachable) at successful turn
completion instead of having no durable home.

LOST-WORKSPACE
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