Skip to content

feat(cli): align native plan with architect - #11170

Merged
johnnyeric merged 3 commits into
mainfrom
johnnyeric/replace-native-plan-with-architect
Jun 15, 2026
Merged

feat(cli): align native plan with architect#11170
johnnyeric merged 3 commits into
mainfrom
johnnyeric/replace-native-plan-with-architect

Conversation

@johnnyeric

@johnnyeric johnnyeric commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Context

We created a new agent in marketplace called Architect and we are now replacing the native plan with architect. Architect still works independently installed from marketplace. We also observed an issue reported in Discord where the marketplace installed agent was having edits blocked and I added an improvement on planning permissions too.

Implementation

This adds a shared Kilo planning classifier for native Plan, Architect, and Architect-like custom agents. Plan mode now gets the Architect-style planning instructions and shared plan-file reminders, including explicit finalize/refine gating before writing the final plan or calling plan_exit.

Planning-agent permissions now preserve plan-file write access even when broad edit denies are present, while still denying source edits and preserving specific deny overrides. Saved plan paths from previous plan_exit calls are reused when refining or handing off from Plan mode. This permissions improvement was based on investigation data provided by Discord user where sessions had permissions block denying all edits and it was a possible reason the architect agent couldn't create the plan files.

Screenshots / Video

CLI

Screenshot 2026-06-12 at 17 41 17

Extension

Screenshot 2026-06-12 at 17 51 21

How to Test

Manual/local verification

  • Agent: bun turbo typecheck passed during push.
  • Tested in the CLI by creating a plan
  • Tested in the extension by creating a plan

Reviewer test steps

  1. Start a native Plan mode session and request a plan.
  2. Confirm the agent asks to finalize/save or continue refining before writing the final plan.
  3. Choose finalize and confirm the plan is saved under the chosen plan path and plan_exit is called with that path.
  4. Set broad edit deny permissions and confirm Plan/Architect can still write markdown plan files, but cannot edit source files.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b3882e2d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/opencode/src/kilocode/agent/index.ts Outdated
Comment thread packages/opencode/src/kilocode/planning.ts Outdated
Comment thread packages/opencode/src/kilocode/agent/index.ts Outdated
Comment thread packages/opencode/src/kilocode/agent/index.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Previous Issues — All Resolved

Issue Status
Planning.mode misleading name ✅ Resolved
denied() false-positive on object-form permissions ✅ Resolved
patchPlanningAgents redundantly re-patches built-in plan agent ✅ Resolved
Two changesets ✅ Resolved
patchPlanningAgents ignores global plan_exit overrides ✅ Resolved
Incremental Changes (commit range: 56e9238..0246320)
  • c9b466c — Added support for repo-root plans/ as valid plan file locations
  • 0246320 — Focused native plan reminder test assertions on plan path behavior, removing architect-specific checks that belong elsewhere
Files Reviewed (9 files total, 7 incremental)
  • .changeset/native-plan-architect-parity.md — updated to mention repo-root plan files
  • packages/opencode/src/kilocode/agent/index.ts — added "plans/*.md": "allow" to plan edit rules
  • packages/opencode/src/kilocode/session/native-plan-prompt.txt — updated plan file location instructions
  • packages/opencode/src/kilocode/session/prompt.ts — updated plan reminder to mention plans/
  • packages/opencode/src/session/prompt.ts (prior review)
  • packages/opencode/test/kilocode/agent-permission-overrides.test.ts — added plans/fix.md allow assertion
  • packages/opencode/test/kilocode/plan-exit-detection.test.ts — updated test expectations and focused assertion scope
Other Observations (unchanged code)
File Note
packages/opencode/src/session/prompt/plan.txt Still not imported anywhere — dead code that can be deleted.
Previous Review Summaries (2 snapshots, latest commit c9b466c)

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

Previous review (commit c9b466c)

Status: No Issues Found | Recommendation: Merge

Previous Issues — All Resolved

Issue Status
Planning.mode misleading name ✅ Resolved
denied() false-positive on object-form permissions ✅ Resolved
patchPlanningAgents redundantly re-patches built-in plan agent ✅ Resolved
Two changesets ✅ Resolved
patchPlanningAgents ignores global plan_exit overrides ✅ Resolved
Incremental Changes (commit range: 56e9238..HEAD)

All changes consistently add support for repo-root plans/ as a valid plan file location:

  • .changeset/native-plan-architect-parity.md — updated to mention repo-root plan files
  • packages/opencode/src/kilocode/agent/index.ts — added "plans/*.md": "allow" to plan edit rules
  • packages/opencode/src/kilocode/session/native-plan-prompt.txt — updated plan file location instructions
  • packages/opencode/src/kilocode/session/prompt.ts — updated plan reminder to mention plans/
  • packages/opencode/test/kilocode/agent-permission-overrides.test.ts — added plans/fix.md allow assertion
  • packages/opencode/test/kilocode/plan-exit-detection.test.ts — updated test expectations
Files Reviewed (9 files total, 6 incremental)
  • .changeset/native-plan-architect-parity.md (incremental)
  • packages/opencode/src/kilocode/agent/index.ts (incremental)
  • packages/opencode/src/kilocode/session/native-plan-prompt.txt (incremental)
  • packages/opencode/src/kilocode/session/prompt.ts (incremental)
  • packages/opencode/src/session/prompt.ts (prior review)
  • packages/opencode/test/kilocode/agent-permission-overrides.test.ts (incremental)
  • packages/opencode/test/kilocode/plan-exit-detection.test.ts (incremental)

Previous review (commit 56e9238)

Status: No Issues Found | Recommendation: Merge

Previous Issues — All Resolved

Issue Status
Planning.mode misleading name ✅ Resolved — planning.ts dropped entirely; logic absorbed as local functions
denied() false-positive on object-form permissions ✅ Resolved — denied() and patchPlanningAgents removed from this PR
patchPlanningAgents redundantly re-patches built-in plan agent ✅ Resolved — removed entirely
Two changesets (soft-plans-edit.md + native-plan-architect-parity.md) ✅ Resolved — soft-plans-edit.md removed
patchPlanningAgents ignores global plan_exit overrides ✅ Resolved — patchPlanningAgents removed entirely
Other Observations (not in diff)
File Note
packages/opencode/src/session/prompt/plan.txt Still not imported anywhere — dead code that can be deleted.
Files Reviewed (5 files)
  • .changeset/native-plan-architect-parity.md
  • packages/opencode/src/kilocode/session/native-plan-prompt.txt
  • packages/opencode/src/kilocode/session/prompt.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/kilocode/plan-exit-detection.test.ts

Reviewed by deepseek-v4-pro-20260423 · 286,294 tokens

Review guidance: REVIEW.md from base branch main

@johnnyeric
johnnyeric force-pushed the johnnyeric/replace-native-plan-with-architect branch from 6b3882e to 1a1dd58 Compare June 12, 2026 18:28
Comment thread .changeset/soft-plans-edit.md Outdated
Comment thread packages/opencode/src/agent/agent.ts Outdated
Comment thread packages/opencode/src/session/prompt.ts
@johnnyeric
johnnyeric force-pushed the johnnyeric/replace-native-plan-with-architect branch from 1a1dd58 to 56e9238 Compare June 12, 2026 21:43
@johnnyeric

Copy link
Copy Markdown
Contributor Author

Simplified the PR and retested. Important to note that I kept the experimental plan path under the flag experimentalPlanMode to minimize upstream changes, but if needed we can also do a clean up there. The block removed inside it was patching the plan with different pieces that were simplified with the architect mode addition.
Screenshot 2026-06-12 at 23 39 48
Screenshot 2026-06-12 at 23 48 20

Comment thread packages/opencode/test/kilocode/plan-exit-detection.test.ts Outdated
@johnnyeric
johnnyeric enabled auto-merge (squash) June 15, 2026 14:05
@johnnyeric
johnnyeric merged commit 3845918 into main Jun 15, 2026
21 checks passed
@johnnyeric
johnnyeric deleted the johnnyeric/replace-native-plan-with-architect branch June 15, 2026 14:20
LigiaZ added a commit that referenced this pull request Jun 15, 2026
Comment thread packages/opencode/src/kilocode/agent/index.ts
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
* feat(cli): align native plan with architect

* fix(cli): support repo-root plan files

* test(cli): focus native plan reminder assertions
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.

3 participants