Skip to content

feat(cloud-agent): scope split images to interactive org sessions - #8903

Merged
eshurakov merged 3 commits into
mainfrom
kilo/hollow-ray-nb7
Oct 28, 2026
Merged

eshurakov merged 3 commits into
mainfrom
kilo/hollow-ray-nb7

Conversation

@eshurakov

@eshurakov eshurakov commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add org-scoped split-image startup: a runtime target can select downloaded/runtime-free startup for listed organizations and interactive web routes (clientProvenance: browser). Other sessions keep the all-in-one app image.
  • Startup mode and physical image are selected together once per new isolated native allocation, and are kept through snapshot fallback. Snapshot capture stays keyed by the recorded start image.
  • Allow manual runtime publication (workflow_dispatch) for an exact main SHA that has a trusted CI push run. This lets us publish split images to R2 and the registry without changing what production runs. Replaces ci(cloud-agent): allow manual runtime publication from main #8968.
  • The organization scope applies to native containers only. Vercel follows the deployment mode, as on main since feat(cloud-agent): add BYOC Vercel compute #8859. Persisted client provenance now accepts agent-manager; only browser qualifies for the cohort.
  • No target is enrolled. runtime-targets.json keeps every target on preinstalled/all-in-one. Production deploys do not depend on publication after this merges.

Verification

  • After the rebase on main: worker and wrapper typecheck, 4935 unit tests, the Workers integration suite (26 files), and pnpm run test:runtime-ci (36 tests) passed.
  • Earlier on this branch: 933 focused unit tests, 14 Workers-runtime integration tests, and Worker and wrapper typechecks passed.
  • No manual publication run, deploy, or real-provider session was performed.

Visual Changes

N/A

Reviewer Notes

  • Manual dispatch only works from main. Test it after merge with gh workflow run cloud-agent-runtime-publish.yml --ref main -f source_sha=<main-sha>, then check the handoff object and the kilo-runtime-base digest for that SHA.
  • Automatic publication stays off until CLOUD_AGENT_RUNTIME_PUBLICATION_ENABLED=true.
  • Deploy jobs now read the handoff with the shared CLOUD_AGENT_RUNTIME_R2_* keys, and the publish job uses CLOUDFLARE_API_TOKEN. This is broader access than separate read-only and publish-only credentials.
  • Enrolling an organization later needs a separate catalog change, publication enabled, and real-provider qualification per docs/runtime-rollout.md.

…l runtime publication

Add an org-scoped downloaded/runtime-free startup target for interactive web routes on isolated native containers, allow manual runtime publication for an exact main SHA, and keep every committed runtime target on preinstalled all-in-one images.
@eshurakov
eshurakov force-pushed the kilo/hollow-ray-nb7 branch from b716978 to 7c98066 Compare October 27, 2026 23:13
@eshurakov
eshurakov marked this pull request as ready for review October 27, 2026 23:13
Comment thread .github/workflows/deploy-workers.yml Resolved
@kilo-code-bot

kilo-code-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental commit changes only docs/runtime-rollout.md (5 added lines), and the new "Known limitation" note matches current code: launchBuilder resolves its start with env: {} (SandboxContainers.ts:441), so builder snapshots carry the all-in-one app image and fail planNativeStart image matching (native-start.ts:114) for runtime-free allocations, while repository snapshots captured by a runtime-free container still restore under the B1 behavior. This accurately records the previously reported environment-builder limitation.

Assumptions: [INFERENCE] The prior .github/workflows/deploy-workers.yml least-privilege finding remains in code but is an author-acknowledged accepted tradeoff recorded in the PR Reviewer Notes, so it is not re-raised. The PR description is still stale about scope (it says native containers only and browser provenance only, while the docs cover Vercel and all cloud-agent-web routes). No manual publication, deploy, or real-provider run was observable.

Files Reviewed (1 file, 5 changed lines)
  • services/cloud-agent-next/docs/runtime-rollout.md - 0 issues
Previous Review Summaries (2 snapshots, latest commit 4ad83d3)

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

Previous review (commit 4ad83d3)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

Both previously reported findings still reproduce on current HEAD: deploy jobs retain the publisher's write-capable R2 credentials plus the account-wide CLOUDFLARE_API_TOKEN, and the environment builder still starts the app image so runtime-free cohort containers cannot restore its snapshots. The incremental commit (dropping persisted client provenance and extending org scoping to Vercel) adds no new defects.

Assumptions: [INFERENCE] The environment builder cannot run the runtime-free image (it lacks the builder entrypoint), and the actual scope of CLOUDFLARE_API_TOKEN is not verifiable from the repository. No manual publication, deploy, or real-provider run was observable. The PR description is now stale: it still says the scope applies to native containers only and that only browser provenance qualifies, while current code and docs/runtime-rollout.md include Vercel and all cloud-agent-web routes.

Overview

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

WARNING

File Line Issue
.github/workflows/deploy-workers.yml 91 Deploy jobs now hold the publisher's write-capable R2 credentials, and the publish job uses the account-wide CLOUDFLARE_API_TOKEN; the read-only/publish-only split is removed.

SUGGESTION

File Line Issue
services/cloud-agent-next/scripts/runtime-target.ts 127 runtime-free is a separate image from app, but launchBuilder resolves starts without nativeImage, so builder snapshots fail planNativeStart image matching for runtime-free cohort containers.
Files Reviewed (12 incremental files)
  • services/cloud-agent-next/docs/runtime-rollout.md - 0 issues
  • services/cloud-agent-next/src/control-plane/sandbox/sandbox-do.ts - 0 issues
  • services/cloud-agent-next/src/persistence/session-metadata.test.ts - 0 issues
  • services/cloud-agent-next/src/persistence/session-metadata.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/downloaded-startup.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/session-credentials.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/session-credentials.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/startup-selection.ts - 0 issues
  • services/cloud-agent-next/src/session/session-prepare.test.ts - 0 issues
  • services/cloud-agent-next/src/session/session-registration.ts - 0 issues
  • services/cloud-agent-next/src/shared/control-plane-protocol.ts - 0 issues
  • services/cloud-agent-next/test/integration/sandbox-runtime-startup.test.ts - 0 issues

Carried forward after current-code verification (files outside the incremental diff): .github/workflows/deploy-workers.yml - 1 issue, services/cloud-agent-next/scripts/runtime-target.ts - 1 issue.

Previous review (commit 7c98066)

Status: 2 Issues Found | Recommendation: Address before merge

Executive Summary

The org-scoped startup selection, image plumbing, provenance persistence, and manual publication admission are consistent with the documented design; the issues are a least-privilege regression in runtime publication credentials and a rollout gap where runtime-free cohort containers cannot restore environment-builder snapshots.

Assumptions: [INFERENCE] The environment builder cannot run the runtime-free image (it lacks the builder entrypoint), so the snapshot mismatch is not already handled elsewhere; the actual scope of CLOUDFLARE_API_TOKEN could not be verified from the repository. No manual publication, deploy, or real-provider run was observable.

Overview

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

WARNING

File Line Issue
.github/workflows/deploy-workers.yml 91 Deploy jobs now hold the publisher's write-capable R2 credentials, and the publish job uses the account-wide CLOUDFLARE_API_TOKEN; the read-only/publish-only split is removed.

SUGGESTION

File Line Issue
services/cloud-agent-next/scripts/runtime-target.ts 127 runtime-free is a separate image from app, but the environment builder still starts app, so its snapshots always fail planNativeStart image matching for runtime-free cohort containers.
Files Reviewed (30 files)
  • .github/workflows/cloud-agent-runtime-publish.yml - 0 issues
  • .github/workflows/deploy-workers.yml - 1 issue
  • services/cloud-agent-next/docs/runtime-publication.md - 0 issues
  • services/cloud-agent-next/docs/runtime-rollout.md - 0 issues
  • services/cloud-agent-next/package.json - 0 issues
  • services/cloud-agent-next/scripts/runtime-handoff.test.ts - 0 issues
  • services/cloud-agent-next/scripts/runtime-manual-admission.mjs - 0 issues
  • services/cloud-agent-next/scripts/runtime-manual-admission.test.mjs - 0 issues
  • services/cloud-agent-next/scripts/runtime-target.test.ts - 0 issues
  • services/cloud-agent-next/scripts/runtime-target.ts - 1 issue
  • services/cloud-agent-next/scripts/runtime-workflow.test.mjs - 0 issues
  • services/cloud-agent-next/src/control-plane/sandbox/sandbox-do.ts - 0 issues
  • services/cloud-agent-next/src/persistence/session-metadata.test.ts - 0 issues
  • services/cloud-agent-next/src/persistence/session-metadata.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-containers/SandboxContainers.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-containers/sandbox-containers.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/cloudflare-containers-provider.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/downloaded-startup.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/provider-creation.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/provider.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/session-credentials.test.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/session-credentials.ts - 0 issues
  • services/cloud-agent-next/src/sandbox-control/startup-selection.ts - 0 issues
  • services/cloud-agent-next/src/session/session-prepare.test.ts - 0 issues
  • services/cloud-agent-next/src/session/session-registration.ts - 0 issues
  • services/cloud-agent-next/src/shared/control-plane-protocol.ts - 0 issues
  • services/cloud-agent-next/src/shared/runtime-startup-config.ts - 0 issues
  • services/cloud-agent-next/src/types.ts - 0 issues
  • services/cloud-agent-next/test/integration/sandbox-control-v2-environment-snapshots.test.ts - 0 issues
  • services/cloud-agent-next/test/integration/sandbox-runtime-startup.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by deepseek-flash-latest · Input: 33.9K · Output: 4.6K · Cached: 271.1K

Review guidance: REVIEW.md from base branch main

…nt provenance

Drop the persisted clientProvenance field so a Worker rollback can still parse stored routes, and apply the interactive org cohort to Vercel startup as well.
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