Skip to content

fix(plan): restore unconditional plan_exit tool registration#6699

Merged
alex-alecu merged 4 commits intomainfrom
fix/plan_exit_regression
Mar 6, 2026
Merged

fix(plan): restore unconditional plan_exit tool registration#6699
alex-alecu merged 4 commits intomainfrom
fix/plan_exit_regression

Conversation

@alex-alecu
Copy link
Contributor

Summary

  • A merge conflict resolution accidentally gated PlanExitTool behind KILO_EXPERIMENTAL_PLAN_MODE && KILO_CLIENT === "cli", which meant the plan agent could never signal completion on VS Code (or CLI without the experimental flag)
  • This broke the "looks good, implement" flow — the follow-up prompt never appeared and no new code-mode session was created
  • Restores PlanExitTool to unconditional registration (it's already gated by agent permissions)

Regression of #6240.

A merge conflict resolution incorrectly gated PlanExitTool behind
KILO_EXPERIMENTAL_PLAN_MODE && KILO_CLIENT === "cli", preventing the
plan agent from signaling completion. This broke the "looks good,
implement" flow — the follow-up prompt never appeared and no new
code-mode session was created.

Regression of #6240.
@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 6, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/tool/batch.ts 5 Hardcoding plan_exit in DISALLOWED still leaves other PermissionNext-denied tools reachable through batch.
Other Observations (not in diff)

No additional issues found outside the diff.

Files Reviewed (2 files)
  • packages/opencode/src/tool/batch.ts - 1 issue
  • packages/opencode/src/tool/registry.ts - 0 issues

BatchTool rebuilds its tool map from ToolRegistry.tools() without
passing the caller agent, so agent-level permission filtering is
bypassed. Add plan_exit to the DISALLOWED set to prevent non-plan
agents from triggering it via batch.
@alex-alecu alex-alecu merged commit e33e18a into main Mar 6, 2026
11 checks passed
@alex-alecu alex-alecu deleted the fix/plan_exit_regression branch March 6, 2026 13:36
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