Commit Graph

3736 Commits

Author SHA1 Message Date
Alex Alecu af83b19bec fix(cli): simplify self-config tips 2026-03-31 08:50:43 +03:00
Aarav 904b2d83d2 Merge branch 'main' into feat/deprecate-orchestrator-agent 2026-03-30 21:23:41 -06:00
Aarav Sharma 12d292ec08 fix: propagate deprecated field in agent merge and show description in dialog 2026-03-30 16:50:38 -06:00
kiloconnect[bot] 03691ebe4e fix(cli): restore directory tree in system prompt
Remove accidental `&& false` that was introduced in upstream commit
351ddeed91 ("Permission rework #6319") which disabled the filetree
from being included in the system prompt for git projects.

Upstream issue: https://github.com/anomalyco/opencode/issues/19263
2026-03-30 16:50:24 +00:00
Marian Alexandru Alecu 40d3a23af4 Merge pull request #7929 from Kilo-Org/feat/ask-agent-read-tools
feat(cli): add read-only bash and MCP to Ask agent
2026-03-30 18:06:36 +03:00
Alex Alecu 14438b9936 fix(cli): use git branch --list instead of -l 2026-03-30 18:01:12 +03:00
Alex Alecu 657296a08b fix(cli): clarify read-only wording in ask prompt 2026-03-30 16:39:48 +03:00
Alex Alecu b007fa2d92 fix(cli): restrict git branch/tag/remote to read-only flags 2026-03-30 16:39:13 +03:00
Alex Alecu ca92e63b0f fix(cli): use allowlist for read-only git cmds 2026-03-30 16:28:53 +03:00
Alex Alecu 6fadd9de99 fix(cli): user denies override MCP ask rules
Re-apply user deny rules after the ask-specific config so explicit
user denies for MCP servers are not overridden by the generated
mcpRules 'ask' defaults.
2026-03-30 15:31:47 +03:00
Alex Alecu a68cf47dac fix(cli): remove find from Ask allowlist, add git write denials
find has -exec/-execdir/-delete flags that execute arbitrary commands
or delete files, bypassing the prefix-based permission check. Also add
missing git write subcommand denials: config, clone, pull, init,
worktree, submodule, revert, bisect, filter-branch, fetch, restore.
2026-03-30 15:21:55 +03:00
Alex Alecu 1d7bc41841 feat(cli): add MCP tool support to Ask agent
Dynamically build per-server permission rules from cfg.mcp at agent init
time using the same sanitization as mcp/index.ts. MCP tools get "ask"
permission so every call requires user approval. Rules are spread after
"*": "deny" to override via findLast() semantics.
2026-03-30 15:03:40 +03:00
Marius 2cdf6b61c7 perf(cli): cache MCP listTools results to avoid redundant RPCs per loop step (#7922)
MCP.tools() called client.listTools() for every connected server on
every agent loop iteration. With multiple servers this added hundreds
of milliseconds of overhead per step (measured ~300-750ms for remote
servers like Vercel).

Cache listTools results in a module-level Map and return them on
subsequent calls. The cache is invalidated on:
- ToolListChangedNotification from the MCP server
- Server add/connect/disconnect
- Instance dispose (config change, project switch, shutdown)
2026-03-30 14:02:57 +02:00
Alex Alecu 15ac71c5f0 feat(cli): add read-only bash commands to Ask agent
Define a readOnlyBash allowlist with deny-by-default semantics so the
Ask agent can run safe information-gathering commands (ls, cat, grep,
git log, find, jq, etc.) while blocking all write operations. Git write
subcommands (commit, push, merge, reset, etc.) are explicitly denied.
gh commands require user approval.
2026-03-30 15:02:23 +03:00
Aarav Sharma e9060468a1 core: deprecate orchestrator agent with visual badge across UI
Mark the orchestrator agent as deprecated so users see a warning badge
in the mode switcher and agent settings, signaling they should migrate
to other agent configurations for task delegation.
2026-03-29 17:24:52 -06:00
Marius 8102d801b9 fix(cli): gate Kilo API calls behind enabled_providers to prevent data leaks (#7813)
Skip Kilo provider injection, fetchDefaultModel, and ACP fallback when
enabled_providers is set and doesn't include kilo. Teams using only their
own models (e.g. LiteLLM) no longer make any external calls to api.kilo.ai.
New users without config are unaffected — Kilo free still works by default.
2026-03-27 17:19:31 +01:00
Marius 9cf83d8122 fix(cli): make FreeUsageLimitError non-retryable to prevent unrecoverable backoff loop (#7809)
* fix(cli): make FreeUsageLimitError non-retryable to prevent unrecoverable backoff loop

When a free model hits its usage cap, the retry loop would endlessly
retry with the same stale model reference. Switching models in the chat
selector could not break the loop because the processor captures the
model once at creation time. Making FreeUsageLimitError non-retryable
surfaces the error immediately so users can switch models and continue.

* chore(kilo-docs): update source links after removing FreeUsageLimitError URL
2026-03-27 17:19:30 +01:00
Evgeny Shurakov 49bb16ca31 Merge pull request #7733 from Kilo-Org/eshurakov/actually-afterthought
Cli - Include parentSessionId in heartbeat session info
2026-03-27 14:17:55 +01:00
Marian Alexandru Alecu 3445ce86b1 Merge pull request #7773 from Kilo-Org/fix/cli-empty-tool-calls-loop
fix(cli): infinite empty tool-calls loop when model returns tool_calls with no tools
2026-03-27 12:09:17 +02:00
Alex Alecu 05a82b37b8 fix(cli): prevent infinite loop on empty tool-calls (#7756)
When the model returns finish_reason "tool-calls" but emits zero tool call
parts, the prompt loop spins indefinitely. Detect this degenerate case in the
processor after the stream completes: if finish is "tool-calls" but no tool
parts exist, convert finish to "stop" so the loop's exit checks terminate
normally.
2026-03-27 12:02:57 +02:00
Marian Alexandru Alecu 536f7f9efb Merge pull request #7603 from Kilo-Org/feat/builtin-config-skill
feat(cli): add built-in kilo-config skill
2026-03-27 11:45:15 +02:00
Alex Alecu 38e0621b94 feat(cli): add TUI settings reference to kilo-config skill
The agent had no knowledge of ctrl+p commands, themes, or appearance
toggling, so it told users to change their terminal settings instead.
Add a TUI Settings section covering all command palette actions,
keybinds, and slash commands, and widen the skill description to
trigger on settings/appearance questions.
2026-03-27 10:26:26 +02:00
Alex Alecu d904bc7dc7 fix(cli): guard builtin skill removal after lookup 2026-03-27 09:53:51 +02:00
Alex Alecu 2485dc926c docs(cli): fix managed config paths for all platforms 2026-03-27 09:48:52 +02:00
Alex Alecu 61170cea0b fix(cli): reject removal of built-in skills 2026-03-27 09:48:24 +02:00
Marian Alexandru Alecu 726a60ce63 Merge branch 'main' into feat/builtin-config-skill 2026-03-27 09:42:00 +02:00
Alex Alecu e4600cd8f9 fix(cli): normalize paths to prevent .. bypass 2026-03-27 09:33:45 +02:00
Marian Alexandru Alecu d92ea980f7 Merge branch 'main' into feat/config-permission-protection 2026-03-27 09:17:23 +02:00
Evgeny Shurakov 4f5466d086 feat(cli): include parentSessionId in heartbeat session info 2026-03-26 21:58:37 +01:00
Alex Alecu 97bad6d8d7 fix(cli): exempt plan files and protect global config dir from silent access
Plan files (.kilo/plans/*.md) were incorrectly flagged as config files
by isRelative(), causing permission prompts for the plan agent. Add
EXCLUDED_SUBDIRS to skip non-config subdirectories under config dirs.

Extend isRequest() to also check external_directory permissions against
global config paths (~/.config/kilo/), preventing 'Always allow' from
granting permanent directory access to config directories.
2026-03-26 19:19:14 +02:00
Marius eea5c88f56 fix: isolate checkpoints per worktree (#7690)
* fix: isolate checkpoints per worktree

* fix: preserve legacy checkpoint history

* fix: lazily initialize worktree checkpoints
2026-03-26 16:40:54 +01:00
Alex Alecu 2dba685256 refactor(cli): extract helpers to reduce duplication 2026-03-26 17:13:19 +02:00
Alex Alecu a2151478ee fix(cli): check movePath in apply_patch config guard 2026-03-26 17:03:58 +02:00
Alex Alecu 6105e356a9 fix(cli): detect nested config dirs in isRelative 2026-03-26 17:03:39 +02:00
Marian Alexandru Alecu ed03c64710 Merge branch 'main' into feat/config-permission-protection 2026-03-26 17:01:41 +02:00
Marius f2dcafc2c5 fix(cli): strip bloated file contents from tool metadata to fix session loading perf (#7706)
Edit, apply_patch, and user message summary were storing full before/after
file contents in metadata — causing sessions to balloon to 90+ MB and crash
the VS Code extension on load.

Strip before/after from edit filediff, apply_patch files[], and
summary.diffs both at write time (new data) and read time (existing data).
2026-03-26 15:47:04 +01:00
Evgeny Shurakov b63a9393dc Merge pull request #7689 from Kilo-Org/eshurakov/retry-limit
Cli - Add configurable session retry limit
2026-03-26 15:23:59 +01:00
Evgeny Shurakov b7fdbe63ea fix(cli): use load-time constant for KILO_SESSION_RETRY_LIMIT 2026-03-26 14:54:27 +01:00
Marius 79d2567e6c fix(cli): hide commit-message git windows on Windows (#7692)
Prevent cmd.exe flashes when commit message generation shells out to git on Windows and add a regression test for the subprocess flags.
2026-03-26 13:59:04 +01:00
Alex Alecu 1cb4b5c8c0 refactor(cli): clean up code quality issues 2026-03-26 14:11:54 +02:00
Alex Alecu 664ceecc32 refactor(cli): reuse MAX_DIFF_SIZE constant 2026-03-26 14:06:16 +02:00
Alex Alecu 721b3d0630 chore(cli): add missing kilocode_change markers 2026-03-26 13:59:08 +02:00
Evgeny Shurakov 435d82ca08 fix(cli): add configurable session retry limit 2026-03-26 12:54:28 +01:00
Alex Alecu bfbfbb967c chore(cli): add kilocode_change markers 2026-03-26 13:52:48 +02:00
Alex Alecu 3ed648d566 refactor(cli): extract max diff size constant 2026-03-26 13:51:24 +02:00
Marian Alexandru Alecu 8b676f8961 Merge branch 'main' into fix/session-diff-memory-leak 2026-03-26 11:41:40 +02:00
Alex Alecu 5d611d6da6 revert: remove /new worker/subprocess restart
The subprocess restart approach did not solve the underlying Bun native
memory retention issue (oven-sh/bun#28318). Remove all restart plumbing
from rpc.ts, thread.ts, worker.ts, app.tsx, and sdk.tsx to keep the
diff clean. The diff-size and store-eviction fixes remain.
2026-03-26 11:40:49 +02:00
Alex Alecu 1596cae383 fix(cli): use subprocess instead of Worker thread for actual memory reclamation
Bun Workers are threads within the same OS process — terminate() frees
the JSC context but mimalloc retains every page process-wide, so the
previous Worker-restart approach had zero effect on RSS.

Switch to Bun.spawn() with IPC which creates a separate child process.
Killing that process returns all its native memory to the OS.

The IPC relay pattern means the RPC client persists across subprocess
restarts — event listeners, fetch proxy, and SDK all continue working
without getter-indirection or rebinding.

Workaround for https://github.com/oven-sh/bun/issues/28318
2026-03-26 11:28:14 +02:00
Marian Alexandru Alecu 4a2d979395 Merge pull request #7056 from Githubguy132010/fix/block-subagents-spawning-subagents
fix: block subagents from spawning subagents
2026-03-26 11:18:14 +02:00
Alex Alecu a7d37318cb fix(cli): replay workspace after restart 2026-03-26 10:46:45 +02:00