Skip to content

fix(cloud-agent-next): run review sessions with platform config only - #8545

Merged
eshurakov merged 1 commit into
mainfrom
fix/review-session-runtime-config
Oct 22, 2026
Merged

eshurakov merged 1 commit into
mainfrom
fix/review-session-runtime-config

Conversation

@lambertjosh

Copy link
Copy Markdown
Contributor

Summary

Code Reviewer sessions now start the Kilo server with KILO_DISABLE_PROJECT_CONFIG=1 and KILO_DISABLE_EXTERNAL_SKILLS=1, so a review runs with the configuration, rules and skills the platform provides rather than whatever project-level config the reviewed checkout carries. Repository review guidance keeps coming from REVIEW.md on the base branch, which is fetched separately.

  • src/shared/kilo-server-env.ts: one helper, kiloServerEnvForOrigin, returns the flags for createdOnPlatform === 'code-review' and nothing for other origins.
  • Legacy plane (agent_*): applied in SessionService.buildRuntimeEnv alongside the other reserved Kilo variables, so profile env cannot override it.
  • Control plane (workspace_*): applied in buildWorktreeKiloEnvironment, which now reads createdOnPlatform from the route spec it already receives.

Other session origins are unchanged.

Verification

  • Ran Kilo CLI 7.8.1 (the sandbox image version) locally against a test checkout with both flags set: platform rules and skills under the session HOME still load, and project-level config and skills are ignored.
  • Not exercised end to end in a deployed review sandbox.

Visual Changes

N/A

Reviewer Notes

The flags are set after profile and inherited env in both planes, matching how KILO_EXPERIMENTAL_BACKGROUND_SUBAGENTS is pinned today.

🤖 Generated with Claude Code

Code Reviewer sessions now start the Kilo server with project-level
configuration and skill discovery disabled, on both the legacy and
control-plane runtimes. Platform rules and skills under the session
HOME are unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kilo-code-bot

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

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Reviewed the new kiloServerEnvForOrigin helper and its two application points. Both spreads are placed after profile/inherited env and before the reserved-token values, so a profile cannot override the flags in either plane, and non-code-review origins receive no new env keys. Verified that control-plane session.prepare reaches buildWorktreeKiloEnvironment with createdOnPlatform (the Sandbox DO injects it from credentialSource in materializePrepareFrame, sandbox-do.ts:3540), and that the runtime passes the prepared env to the Kilo server (kilo-runtime.ts:242) so the flags survive a runtime restart. Legacy agent_* sessions pass the env through the attach payload to assignProcessEnv, which restarts the server on env change.

Assumptions: [INFERENCE] The exact CLI semantics of KILO_DISABLE_EXTERNAL_SKILLS (HOME-provided skills continue to load) cannot be verified from this repository; the PR description states it was confirmed against CLI 7.8.1. Platform-skills behavior and deployed end-to-end behavior were not exercised here.

Files Reviewed (5 files)
  • services/cloud-agent-next/src/shared/kilo-server-env.ts - no issues
  • services/cloud-agent-next/src/session-service.ts - no issues
  • services/cloud-agent-next/src/session-service.test.ts - no issues
  • services/cloud-agent-next/wrapper/src/control/worktree-runtime.ts - no issues
  • services/cloud-agent-next/test/unit/wrapper/worktree-credential-refresh.test.ts - no issues

Reviewed by deepseek-flash-latest · Input: 87K · Output: 17.5K · Cached: 2.9M

Review guidance: REVIEW.md from base branch main

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