The kilocode_change marker sat on the comment line above the statement, but
check-opencode-annotations.ts only accepts an inline marker on the changed
line itself or a line inside a start/end block, so CI reported the env pin in
the shared agent test as an unannotated Kilo change.
The backend injected KILO_CONFIG_CONTENT={"permission":{"edit":"ask"}} on
every `kilo serve` spawn. The CLI merges that layer after global and project
config, so permission.edit from ~/.config/kilo/kilo.json, project kilo.jsonc,
.kilo/kilo.jsonc, and the plugin's own Auto-Approve settings page were all
silently discarded.
Move the JetBrains edit-ask default into the CLI's client-keyed defaults
layer, which sits below user config, so every user layer overrides it while
the out-of-the-box approval prompt is preserved.
Also correct the Auto-Approve page's inherited level for `edit`, which showed
"Allow" while the effective action was "ask".
* fix(cli): stop read-only agent bash denies from blocking delegated subagents
When a read-only or delegating agent (plan, ask, orchestrator) delegated to a
custom subagent via the task tool, the subagent was blocked from running
commands its own config explicitly allowed (e.g. `git status`) with errors
citing deny rules the user never wrote (`git *`, `*`, shell-operator guards).
Those phantom rules are the calling agent's `readOnlyBash` allowlist. Its deny
rules exist only to shape that allowlist; `KiloTask.inherited` was extracting
them (deny-only) and appending them as subagent ceilings, where last-match-wins
resolution made `git * deny` / `* deny` override the subagent's own allows.
Drop `bash` from the inherited-ceiling set so the calling agent's own bash
policy no longer caps a writable subagent. Edit, notebook, and MCP denials
remain hard ceilings, and an explicit session-scoped bash lockdown still reaches
the child via `deriveSubagentSessionPermission`, which inherits session denies.
Fixes#11523
* fix(cli): keep plan's destructive-command denies as subagent ceilings
Removing bash from the inherited ceilings globally made the default
Plan->Explore path writable: Plan can delegate to Explore without asking, and
the built-in Explore agent declares bash: "allow", so rm -rf and git push
both resolved to allow on the merged tree.
Re-inherit plan's concrete destructive-command denies (rm -rf *, git push*) as
ceilings while leaving the broad allowlist-shaping denies uninherited, so a
writable subagent keeps its own bash policy and the read-only boundary holds.
* fix: implemented the review fixes
Implemented the review fixes.
- Built-in Explore now has an enforcement-level read-only bash policy, even if user config sets `bash: allow`.
- Plan and orchestrator delegation deny mutations while allowing `git status` and `rg`.
- `gh` and raw `find` are denied for delegated Explore.
- Custom writable subagents retain their own bash allowlists.
- Removed the incomplete Plan-only `rm -rf`/`git push` ceilings.
- Added focused regression coverage.
```text
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
* feat(agent-requirements): gate agents on declared requirements
* feat(cli): add agent requirements preflight helpers
Introduce a Kilo-owned CLI requirements module that preflights agent
declarations before session creation. The helper resolves requirement
status via the SDK, blocks agents with unmet skills, errored MCPs, or
VS Code extension dependencies, and produces grouped actionable
guidance for terminal users.
Includes planning documents and a focused test suite covering all
blocking and allow paths.
* chore: update kilo-vscode visual regression baselines
* fix(vscode): guard extension subscription and suppress empty invalidations
Wrap vscode.extensions.onDidChange in a typeof check so the subscribe
callback is undefined in environments where the API is unavailable.
Skip posting agentRequirementsInvalidated when the controller cache is
already empty to avoid spurious messages to the webview.
Update the associated test to seed cache state before asserting on the
clear-triggered invalidation flow.
* refactor(agent-requirements): replace numeric generations with object-identity tokens
Switch the controller's supersession tracking from incrementing counters
to ephemeral object references, ensuring stale tokens are cleaned up on
both success and failure paths. This eliminates a class of race
conditions where cleared counters could alias with fresh requests.
Conditionally emit the "Install the required skills..." footer in the
CLI formatter only when skills or MCPs are actually present, preventing
misleading guidance for extension-only requirement failures.
* test(httpapi): add exercise scenario for agent requirements endpoint
Cover the GET /kilocode/agent/requirements route in the HTTP API
exercise harness, asserting that the response echoes the requested
agent, uses the routed workspace directory, and correctly reports
the disabled state with empty skills/mcps/extensions arrays.
* feat(agent-requirements): enforce guard across all clients and relax ID validation
Lift the VS Code–only restriction from the requirements guard so
that blocked skills/MCPs fail for CLI and other clients as well.
VS Code extension requirements remain client-specific. The evaluate
function now accepts pre-decoded requirements as an explicit input
rather than decoding internally, and the schema switches from the
strict alphanumeric ID pattern to a permissive non-whitespace Name
pattern allowing slashes and spaces in skill/MCP identifiers.
Update prompt interfaces to surface RequirementBlockedError in the
typed error channel and preserve "ready" results in the webview
cache alongside blocked/error states.
* chore(opencode): fix requirement guard annotations
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Introduce a primaryWorktree Effect that queries Git plumbing commands
to locate the main checkout from any linked worktree. Integrate it
into config loading so .kilo directory settings from the primary
checkout act as local-scoped fallbacks beneath the active worktree
and KILO_CONFIG_DIR overrides.
Wire primaryPaths into skill discovery so project skills installed in
the primary checkout appear as fallbacks unless overridden locally.
Refactor session family matching to consider sandbox directories and
filter out nested Git repositories when resolving worktree roots.
Convert baselineDirectory in indexing to an Effect that delegates to
primaryWorktree instead of reading Instance.project.worktree directly.
Restore the content() signal usage in the TUI text part renderer.
Provide Git.defaultLayer across all affected test layers and add
coverage for linked worktrees, submodules, paths with spaces, sandbox
project matching, and primary config directory precedence.
* refactor(opencode): migrate agent promise helpers to kilocode module and adopt Effect-based tests
Remove legacy promise-based helpers (`get`, `list`, `defaultAgent`, `remove`)
from the core agent module and update callsites to use the dedicated
`@/kilocode/agent` module directly. Migrate kilocode-specific tests from
`WithInstance.provide` patterns to the `testEffect` helper with Effect
generators for cleaner, more idiomatic test code.
- Remove `makeRuntime` import and exported promise helpers from agent.ts
- Update HTTP API handlers to import from `@/kilocode/agent` instead of
re-exported `Agent` namespace
- Rewrite agent tests to use `load()` helper or Effect service access
- Convert agent-global-config-dirs and agent-skill-permissions tests to
`testEffect` pattern
- Reorder SDK type definitions (BackgroundProcessLogs/WorkspaceWarpError)
* chore(auth): remove legacy promise helpers and replace with direct Effect service access
Eliminate the exported promise-based convenience functions (`get`, `all`,
`set`, `remove`) from the Auth module and replace all callsites with
explicit `AppRuntime.runPromise` or `makeRuntime` invocations that access
`Auth.Service` directly through Effect's service pattern.
- Delete `makeRuntime`-backed promise helpers from auth/index.ts
- Update CLI entrypoint, kilo-sessions, indexing, and server instance to
use `AppRuntime.runPromise(Auth.Service.use(...))` for auth access
- Inject `Auth.Service` as a dependency into the ModelsDev layer and
consume it via Effect generator instead of promise wrapper
- Create a local `makeRuntime` instance in model-cache.ts for non-Effect
callsites that still need promise-based auth access
- Rewrite tests to manipulate auth.json directly on disk with proper
save/restore semantics instead of relying on removed helpers
* refactor(suggestion): convert suggest tool to Effect-native with injected Command dependency
Transform the suggestion tool from async/promise-based implementation to
idiomatic Effect generators with explicit dependency injection of the
Command service rather than importing and calling module-level helpers.
- Convert `resolvePrompt` from async function to Effect generator that
accepts a `Command.Interface` parameter
- Refactor `SuggestTool` definition to yield `Command.Service` from the
Effect context and thread it through to `resolvePrompt`
- Add `Command.Service` as a dependency to the tool registry layer and
provide `Command.defaultLayer` in both production and test wiring
- Remove unused `makeRuntime` import and exported `get` helper from
command/index.ts
- Add explicit type annotations to Auth delegate in server instance
- Rewrite suggestion tests to use `testEffect` helper with a mock
`Command.Service` layer instead of spying on module exports
* feat(git): migrate WorktreeFamily to Effect service and wire Git.Service as dependency
Convert WorktreeFamily.list from an async function using legacy promise
helpers to an Effect generator that yields Git.Service from context,
eliminating the need for the removed `run` promise wrapper in git/index.
- Replace `WorktreeFamily.list()` async function with Effect.fn generator
that obtains Git.Service and InstanceState from the Effect context
- Remove legacy `makeRuntime`/`run`/`runPromise` exports from git module
- Update RecallTool to thread Git.Service through to WorktreeFamily calls
via EffectBridge
- Add Git.Service as a required dependency in tool registry and HTTP
server route layers
- Update all test layers to provide Git.defaultLayer
* chore(mcp): replace legacy promise helpers with Effect-native AppRuntime calls
Remove exported promise-based `status`, `connect`, and `disconnect`
helpers from MCP module and convert the network recovery callsite in
SessionNetwork to use AppRuntime.runPromise with Effect.gen directly.
* refactor(auth): adopt makeRuntime helper for Auth service resolution in kilo modules
Replace AppRuntime.runPromise with locally scoped makeRuntime instances
in kilo-sessions and kilocode/indexing modules, removing the dependency
on the global AppRuntime singleton for Auth service access.
* fix(test): simplify cleanup error handling in provider test
Replace try-catch block with promise .catch() for file unlink operation
during test teardown.
Replace direct `Instance.provide` usage with `WithInstance.provide` across
source modules and test files to decouple runtime context provisioning
from the core Instance singleton.
- Update kilo-sessions, remote-sender, roll-call, and plan-followup source
- Remove unused `Instance` imports where only `WithInstance` is needed
- Drop unnecessary `init` param from indexing-worktree test calls
- Add missing `WithInstance` import in fixture-dependent test files
Agents can now create temporary files in the global tmp directory without
triggering external_directory permission prompts. This enables agents to
freely use temporary storage for intermediate files during builds and
other operations.