Repository navigation
feat(agent): land the Kilo agents through the Kilo host - #15238
Conversation
Embedder plugins registered with phase post run after the internal post plugins, so they see the result of config. Without a phase, all() returns what it returned before.
Move KiloAgentPlugin out of core into kilo-plugin. The host registers the agent set before the config plugins and the agent ceiling in the post phase. The ceiling now keeps rules that later post plugins append to every agent. internal.ts and fetch.test.ts are upstream again.
kilo_port proofs accept unattributed:<area> as the feature. Add the agent dispositions and regenerate the map.
|
📈 v2 migration progress: 0.1% → 0.4% (+27 done, -13 total, +13 dropped; 39/9841 cells) Placement: 7 new marked lines in shared files (7 seam), 8 new Ratchets: 8 core-internal imports (base 4); shared patches by rung 16 seam, 1 patch (base 14 seam, 1 patch).
25 cells closed
13 cells dropped
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Incremental review of Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit ba889a8)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit ba889a8)Status: No Issues Found | Recommendation: Merge Incremental review of Files Reviewed (5 files)
Previous review (commit 52a7d0c)Status: No Issues Found | Recommendation: Merge Files Reviewed (24 files)
Reviewed by deepseek-v4.1-flash-1017 · Input: 36.9K · Output: 3.9K · Cached: 246.9K Review guidance: REVIEW.md from base branch |
The typed displayName and source fields are still needed by organization modes, so their patch cells and the metadata test stay open. Only the deprecated badge is dropped.
The progress history follows the first parent. With v2 as the first parent, the branch has the same first-parent history as the PR merge commit, so the generated map does not depend on the branch commit order.
Supersedes #14999. Plan unit U-E2-12.
What Problem This Solves
v2 ships only the upstream agents: Build, Plan, and the General and Explore subagents. Kilo v1 ships Code, Ask, Debug, Orchestrator and Plan, with Kilo prompts and permissions. #14999 implemented them before the Kilo host existed, so it registered the plugins with marked lines in
packages/core/src/plugin/internal.tsand kept the module inside core.Why This Change Was Made
This is the first feature placed with the placement method (
v2-feature-placement). The behavior of #14999 is unchanged, but it is re-homed:packages/core/src/kilocode/topackages/kilo-plugin/src/agent/.KiloPluginslistsKiloAgentPlugin.Plugin; the newKiloPostPluginslistsKiloAgentPlugin.Ceiling. The host (packages/kilo-cli/src/host.ts) registers both throughSdkPlugins.registerand now providesGlobalnext toBus, because the agents read the Global paths.internal.tsis upstream again (no diff to the pin775d1d0d713).ConfigAgentPlugin, which is an internal post plugin.SdkPlugins.registerhad no phase, so one generic seam adds it:register(plugin, { phase: "post" }),all(phase), and one line inplugin/supervisor.tsthat appends the post plugins afterinternal.post.[guard, ...global]as a prefix and skipped any agent with its own config rule once that tail was present (verified: the old check fails the new test). It now finds where the global rules end in the probe and keeps the appended tail last.fetch.test.tsprobe change of feat(core): add Kilo agents #14999 is not needed: the server tests do not start the host, so the Kilo shell defaults are not in that agent list. The file is upstream again.script/upstream/progress.tsacceptskilo_port(unattributed:<area>:<id>), so a Kilo-owned file can close an unattributed patch cell in place.Behavior (from #14999, unchanged):
code, as in v1. It is the default agentbuildbuildkeeps working, and the list has no second Code entry. A hidden agent is never the default, sodefault_agent: "build"selects CodeDifferences from v1 (from #14999; one row changed):
plan_exit, plan prompt.kilo/plans, Kilo plan prompt~/.opencode/planand native Plan reminderagent.buildconfigcodebuildcopy.default_agent: "build"now selects Code (tested)displayNameandsourceagent fields/agent-builder), agent removeUser Impact
Shift+Tabcycles Code, Ask, Debug, Orchestrator, Plan. The prompt shows "Code"."*": "allow"in config does not make Ask or Plan writable.The UI is the same as in #14999; its screenshots apply.
Evidence
Automated (temporary XDG directories, Bun 1.4.0 locally):
bun typecheckinpackages/kilo-plugin,packages/kilo-cli,packages/corebun typecheckinpackages/serverpackages/ai/src/protocols/shared.ts(zstdCompressSync), the same without this change. Local only: this worktree is nested in a checkout whosenode_modules/@types/nodeis 22.13.9bun testinpackages/kilo-pluginKiloAgentPlugin.Ceiling, and with the prefix check of #14999denyexpected,allowreceived)bun testinpackages/kilo-cli* allowplus a Plan rule; Ask and Plan stay read-only, Plan keepscargo search, Orchestrator has no shell, the probe agent is goneplugin/supervisor.test.tsplugin/supervisor-reload.test.tsfetch.test.ts(upstream version), 3 runsvcs.test.ts(itsSdkPluginsfake ignores the phase)bun test progress.test.ts(script/upstream)bun run lintbun run checkzstdCompressSyncerror above (@opencode/plugin-figma)bun script/check-shared-patches.ts,bun script/check-opencode-annotations.tsbun script/upstream/placement.ts --importsbun script/upstream/progress.tsthen--checkTUI self-test (
vscode-self-testrecipe,bun dev --standalonethrough the host, new profile,kilo/kilo-auto/free, test repo withmath.ts):Code · Auto Free Kilo GatewayShift+Tabfive times/agentsdialogmath.tsunchangednode -e "console.log(41+1)"ls{"permission": {"*": "allow"}}: Code runsnode -emath.tsor runsed -imath.tsunchangedNo test was skipped or deleted.
Placement
packages/kilo-plugin/src/agent/index.ts(ctx.agent.transform,ctx.event,ctx.session.synthetic),kilo_port(unattributed:agent:b6727a425792)and 6 moreKiloAgentPlugin.CeilingGlobalfor pluginsKiloPluginsandKiloPostPluginsinpackages/kilo-plugin/src/index.ts,SdkPlugins.registerinpackages/kilo-cli/src/host.ts,kilo_port(agent:2e5632e7bfc6)SdkPluginspackages/core/src/plugin/sdk.ts, 6 lines,shared-patches.jsoninternal.postpackages/core/src/plugin/supervisor.ts, 1 line,shared-patches.jsonpackages/core/src/plugin/sdk.ts(rung 3),packages/core/src/plugin/supervisor.ts(rung 3). Every marked line iskilocode_change(agent) seamand carries no Kilo value.internal.tsandfetch.test.tshave no diff to the pin.packages/kilo-plugin/src/agent/index.ts(no public surface has them; feat(core): add Kilo agents #14999 imported the same modules by relative path):@opencode/core/permission(Permission.evaluatefor the reminder capability line),@opencode/core/util/wildcard(Wildcard.matchin the ceiling),@opencode/core/shelland@opencode/core/tool-output(the output directories that read-only agents may read). Ratchet 4 to 8. Public imports:@opencode/plugin,@opencode/schema,@opencode/util.Progress map:
agent: 0/15 (0%) before, 6/13 (46.2%) after, 2 dropped.unattributed:agent: 0/34 before, 21/23 (91.3%) after, 11 dropped. Total: 12/9854 (0.1%) before, 39/9841 (0.4%) after, 13 dropped.kilo_port(8):agent:2e5632e7bfc6(the KiloPlugins entry);unattributed:agent:b6727a425792(agent map),161afe543464and655072363498(default shell rules),6f9571fe6129anda91ca8efa1b6(Code is the default),55cce67688d4and80e846e9fd1c(hiddenbuildcopy).native(14 patch cells): rebuild on config change (8 cells, v2 reloads the plugin generation onconfig.updated); global config and reference directories (2, v2 Code, Debug and General start with* allow); system agent hardening (4, v2 runs title, summary and compaction without tool execution).dropped(13 cells), each with its row of the differences table: Scout (3), the deprecated badge (1), suggest rules (2), runtime flags for Scout and board (2), the mixed per-agent hardening hunk (Explore, Plan edit guard, metadata lifting, Scout references), agent generation prompt and its telemetry (3, v2 has noagent creategeneration),scout.txt.portedby disposition (feature mismatch, files inkilo-plugincount as featureplugin):kilocode/agent/index.tsand the testsagent-permission-overrides,agent-skill-permissions,ask-agent-permissions.agent-global-config-dirstest:native.builder.ts,POST /kilocode/agent/removeandagent-remove.test.ts(agent builder and remove, U-E2-12 later PR on U-E0-02);options.tsandagent-options-strip.test.ts(the v1 config migration moves agentoptionsintorequest.body, sodisplayNameandsourcefrom v1 markdown agents reach the provider);agent-routing.test.ts(markdown and config routing precedence, U-E1-07, not verified on v2); the typeddisplayNameandsourcefields andagent-config-metadata.test.ts(organization modes in the config box need them).