Skip to content

feat(cloud-agent-next): run subagents in foreground for cloud sessions - #6809

Merged
eshurakov merged 1 commit into
mainfrom
eshurakov/disable-background-subagents
Sep 28, 2026
Merged

eshurakov merged 1 commit into
mainfrom
eshurakov/disable-background-subagents

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

What

Force KILO_EXPERIMENTAL_BACKGROUND_SUBAGENTS=false in every cloud agent session environment (SessionService.getSaferEnvVars), so the Kilo CLI runs Task subagents in the foreground.

Why

Background subagents let the root session emit session.idle before its work is published. cloud-agent-next treats a root session.idle as successful completion, so a run can be marked completed while nothing was actually done. This was observed as code reviews completing with no review posted, because the agent never reached the publication step.

Running subagents in the foreground keeps the root turn blocked on each task call, so it cannot go idle mid-flow.

Notes

  • Set in the system-managed env block, so it applies to all cloud sessions and cannot be overridden by a profile. It also covers Bitbucket reviews, which discard user-provided env vars.
  • Trade-off: subagent work is serialized instead of running in parallel, which lengthens some runs.

Verification

  • pnpm exec vitest run src/session-service.test.ts — 150 passed; the new case asserts the value is false by default and still false when a profile sets true.
  • pnpm run typecheck (root tsgo --noEmit + wrapper typecheck) — pass.
  • oxfmt --check on both changed files — clean.

Set KILO_EXPERIMENTAL_BACKGROUND_SUBAGENTS=false in the session environment so the Kilo CLI runs Task subagents in the foreground. Background subagents let a root session go idle before it publishes its work, which the platform treats as successful completion (observed as code reviews completing with no review posted).
@kilo-code-bot

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

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the two-file change that forces KILO_EXPERIMENTAL_BACKGROUND_SUBAGENTS=false for all cloud session environments; the value is placed in the reserved env block, so it correctly overrides profile/user env and is covered by a new test.

Files Reviewed (2 files)
  • services/cloud-agent-next/src/session-service.ts
  • services/cloud-agent-next/src/session-service.test.ts

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

Review guidance: REVIEW.md from base branch main

@eshurakov
eshurakov enabled auto-merge (squash) September 28, 2026 16:54
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