Commit Graph

433 Commits

Author SHA1 Message Date
kirillk 8816cb8358 fix(cli): plan mode asks for edits outside plan files; sub-agents inherit caller edit restrictions 2026-04-06 10:13:32 -04:00
Marian Alexandru Alecu 726a60ce63 Merge branch 'main' into feat/builtin-config-skill 2026-03-27 09:42:00 +02:00
Alex Alecu 721b3d0630 chore(cli): add missing kilocode_change markers 2026-03-26 13:59:08 +02:00
Alex Alecu df29396d77 feat(cli): add built-in kilo-config skill for on-demand config reference 2026-03-25 14:51:41 +02:00
Thomas Brugman 710ec68828 Merge branch 'main' into fix/block-subagents-spawning-subagents 2026-03-23 17:50:58 +01:00
Catriel Müller 7edd3f6fc2 Merge branch 'main' into catrielmuller/kilo-opencode-v1.2.21 2026-03-18 17:10:56 -03:00
Catriel Müller 426521468f resolve merge conflicts 2026-03-17 11:37:03 -03:00
kiloconnect[bot] 80fa50adf4 fix(cli): replace remaining "opencode" branding references with "kilo"
Replace user-facing and protocol-visible "opencode" strings with "kilo"
across MCP auth flow, CLI commands, server metadata, and other areas
that were missed or reverted during upstream merges.

Files changed:
- mcp/index.ts: MCP client name and auth toast message
- cli/cmd/mcp.ts: config file reference, placeholder, debug client name
- cli/cmd/pr.ts: binary invocations and user messages
- server/server.ts: OpenAPI spec title and description
- server/mdns.ts: mDNS service host and name
- session/retry.ts: credits URL
- provider/provider.ts: CLI command in error message
- acp/agent.ts: auth method name and description
- tool/webfetch.ts: User-Agent header
2026-03-17 12:36:37 +00:00
Catriel Müller 266ceca646 refactor: kilo compat for v1.2.21 2026-03-17 08:50:30 -03:00
DhruvBhatia0 cd26320f62 feat: add WarpGrep AI-powered codebase search tool (#6685)
* feat: add WarpGrep AI-powered codebase search tool

Add WarpGrep integration as a new tool for intelligent multi-step
codebase search. WarpGrep delegates search to Morph's RL-trained
search agent, which runs parallel tool calls across multiple turns
and returns only relevant code spans.

- Add WarpGrep core client with multi-turn API loop, local tool
  executors (ripgrep, file read, directory list), and XML parsing
- Add tool definition gated behind KILO_ENABLE_WARPGREP flag
- Register tool in registry with feature flag gating
- Add warpgrep permission to orchestrator, ask, and explore agents
- Conditionally enhance explore agent prompt when WarpGrep available
- Add unit tests for parsing, file ops, and tool registration

* fix: align warpgrep with Morph XML protocol

* chore: drop warpgrep test changes from branch

* chore: remove warpgrep test files from branch

* refactor: replace custom WarpGrep implementation with @morphllm/morphsdk

- Delete 396-line custom warpgrep.ts, replace with SDK's WarpGrepClient
- Only check MORPH_API_KEY (drop WARPGREP_API_KEY)
- Route through Kilo proxy during free period when no API key is set
- Add actionable error message for when free period ends
- Grep for FREE_PERIOD_TODO to find what to change post-free-period

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: rename warpgrep to codebase_search, add error toast for 429/402

- Rename tool from warpgrep to codebase_search throughout
- Switch proxy URL to /api/gateway
- Detect auth/rate-limit errors (401/402/429) and show actionable
  fallback message telling users to set MORPH_API_KEY
- Fire a TUI toast notification on auth/rate-limit errors so users
  see a visible popup, not just hidden tool output
- Wire up GlobalBus "global.event" in TUI thread so Bus events from
  tools can reach the TUI event system

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* build: bump @morphllm/morphsdk to 0.2.141

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use Bus.publish for toast, revert global.event subscription

Address PR review: emit toast via Bus.publish(TuiEvent.ToastShow)
instead of GlobalBus.emit() so it works in both direct-RPC and
server-backed TUI modes. Revert the global.event subscription in
createEventSource since it's no longer needed and caused double
event delivery.

Also update codebase_search tool description to clarify natural
language input.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add codebase search toggle to experimental settings

Replace KILO_ENABLE_WARPGREP env var with a UI toggle in the
Experimental settings tab. The tool is now gated by the
experimental.codebase_search config field, accessible from both
VSCode settings and TUI config file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update packages/opencode/src/tool/warpgrep.ts

Co-authored-by: Marius <marius@kilocode.ai>

* feat: limit codebase_search output to prevent context bloat

When search results exceed 45k chars (~15k tokens), degrade to showing
file paths and line ranges instead of full content. Also bumps
@morphllm/morphsdk from 0.2.129 to 0.2.147.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* build: bump @morphllm/morphsdk to 0.2.148

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: format codebaseSearch i18n strings to respect prettier line width

* fix: only advertise codebase_search in explore prompt when feature flag is enabled

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Christiaan Arnoldus <christiaan.arnoldus@outlook.com>
Co-authored-by: Marius <marius@kilocode.ai>
2026-03-17 09:06:15 +00:00
Imanol Maiztegui 0484318191 Granular bash permission rules (#7091)
* fix: renamed pattern arrays used for permission rules

* fix: rename savePatternRules to saveAlwaysRules

* feat: generate hierarchical always patterns in bash tool

* feat: validate saveAlwaysRules against always array only

* feat: pass always field through extension bridge to webview

* feat: show hierarchical always patterns in PermissionDock dropdown

* fix: rename pattern to rule in PermissionDock translations, styles, and data-slots

* fix(vscode): correct auto-run comment in PermissionDock

* feat(kilo-vscode): strip trailing wildcard from permission rule labels

* fix: deduplicate permission rules and strip wildcards from display labels

* refactor: move hierarchy to metadata.rules, restore always to arity prefix

* feat: pass always field to permission dock for non-bash tool rules

* fix: correct bash test assertion to check metadata.rules and fix indentation

* fix: hide permission rules dropdown for non-bash tools

* fix: align always-rules route descriptions, whitespace, and restore multi-command tests
2026-03-16 17:43:16 +01:00
Thomas Brugman 4ee4d49d92 fix: deny task in subagent sessions unless agent explicitly allows it 2026-03-15 10:32:46 +01:00
Thomas Brugman c4898d78d1 fix: always deny task permission in subagent sessions 2026-03-15 10:25:52 +01:00
Kevin van Dijk 83cef06f0d Merge pull request #6989 from Kilo-Org/kevinvandijk/kilo-opencode-v1.2.17
OpenCode v1.2.17
2026-03-13 14:06:54 +01:00
Imanol Maiztegui a913731700 Permission toggles per-pattern in permission dock (#6977)
* feat(kilo-vscode): Granular permission layout

* formatting

* chore: update kilo-vscode visual regression baselines

* fix: Make sure pattern permissions are correctly saved

* fix: Only save patterns originally sent

* chore: Moved pattern permission logic to its own endpoint

* tests: Unit tests for pattern permissions handling

* fix: Avoid race conditions on permission reply messages

* fix: Handle missing requestId on pattern permission request

* fix: Return NotFoundError when input.requestID missing

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-13 13:56:57 +01:00
Kevin van Dijk b83c848909 Resolve merge conflicts 2026-03-12 12:42:48 +01:00
Kevin van Dijk e6d04c204b refactor: kilo compat for v1.2.17 2026-03-12 12:19:04 +01:00
Evan Jacobson 67c375ce43 fix: wait for stdio streams to drain before flushing decoders in bash tool
Change proc.once('exit') to proc.once('close') so all stdout/stderr
data events are delivered before StringDecoder.end() is called. The
'exit' event fires when the process exits but before stdio streams
finish draining, which could cause the decoder flush to miss trailing
chunks and corrupt the last multi-byte character.
2026-03-10 12:47:10 -06:00
Evan Jacobson 90fbe52841 fix: flush StringDecoder at EOF to surface trailing buffered bytes
decoder.write() can hold incomplete multi-byte sequences internally.
Without calling decoder.end() after streams close, those trailing bytes
are silently dropped. Flush all decoders after process exit so any
remaining bytes are emitted as replacement characters rather than lost.
2026-03-10 12:31:11 -06:00
Evan Jacobson b13bfe3889 fix: use separate StringDecoder per stream to prevent cross-pipe corruption
Address review feedback: a shared StringDecoder across stdout and stderr
can mix partial UTF-8 bytes between streams. Use one decoder per pipe so
incomplete sequences on stdout are never completed by stderr bytes.
2026-03-10 11:48:04 -06:00
Evan Jacobson 2596acaf3e fix: use StringDecoder for UTF-8 multi-byte stream decoding
Replace chunk.toString() with StringDecoder in stream processing to
prevent garbled characters (arrows, tree-drawing chars appearing as
mojibake) when multi-byte UTF-8 sequences are split across chunk
boundaries. StringDecoder maintains state across chunks to correctly
reassemble incomplete characters.

Fixed in bash tool, prompt shell execution, and ripgrep output.
2026-03-10 11:34:40 -06:00
Marius cae63f8396 fix: add windowsHide to all spawn calls to prevent CMD window flash on Windows (#6813)
Every child_process.spawn() call was missing windowsHide: true, causing
a visible CMD console window to briefly appear on every shell command,
LSP server start, ripgrep search, clipboard operation, and process kill
on Windows. This option is a no-op on non-Windows platforms.
2026-03-10 16:59:49 +01:00
Quan Ran be9b4d1bcd fix(opencode): preserve original line endings in 'edit' tool (#9443)
Co-authored-by: LukeParkerDev <10430890+Hona@users.noreply.github.com>
2026-03-07 07:42:54 +00:00
Alex Alecu 4dc0ed0ff0 fix(batch): disallow plan_exit from batch tool execution
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.
2026-03-06 14:51:16 +02:00
Alex Alecu 4129abac9f fix(plan): restore unconditional plan_exit tool registration
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.
2026-03-06 14:38:47 +02:00
Dax e79d41c70e docs(bash): clarify output capture guidance (#15928) 2026-03-03 21:10:26 -05:00
Kevin van Dijk 8f34422961 Resolve merge conflicts 2026-02-26 12:53:40 +01:00
Kevin van Dijk cfb3b6ef56 refactor: kilo compat for v1.2.13 2026-02-26 03:23:56 +01:00
Kevin van Dijk 2b05e4f40b Resolve merge conflicts 2026-02-25 18:34:18 +01:00
Kevin van Dijk 42a7e019ef refactor: kilo compat for v1.2.11 2026-02-25 18:14:54 +01:00
Marius 8551d95447 perf: filter tool diagnostics to only edited files, reducing session payload 50-77% (#6241)
* perf: filter tool diagnostics to only edited files

Tools (edit, write, apply_patch) stored LSP diagnostics for ALL project
files in their metadata. In large projects this adds 100-500KB of
unrelated diagnostics per tool call, bloating session payloads by
50-77%.

The UI only renders diagnostics for the edited file(s), so the rest is
dead weight. Extract a filterDiagnostics utility that keeps only the
relevant files' diagnostics and use it in all three tools.

* add kilocode_change marker to diagnostics filter test
2026-02-25 14:32:42 +01:00
Marian Alexandru Alecu 3653c79395 Merge branch 'main' into fix/fix-plan-mode-suggestions 2026-02-25 09:45:49 +02:00
Dax Raad fa559b0385 core: temporarily disable plan enter tool to prevent unintended mode switches during task execution 2026-02-24 23:05:26 -05:00
Dax 814c1d398c refactor: migrate Bun.spawn to Process utility with timeout and cleanup (#14448) 2026-02-24 23:04:15 -05:00
Luke Parker 3af12c53c4 fix(opencode): import custom tools via file URL (#14971) 2026-02-25 10:24:47 +10:00
Alex Alecu 0886ef8fa0 fix(plan): Show implementation suggestions only when LLM has all the information 2026-02-24 15:32:58 +02:00
Kevin van Dijk 496c4283e1 Fix types 2026-02-23 20:34:24 +01:00
Kevin van Dijk ae62fff98d Resolve merge conflicts 2026-02-23 20:12:28 +01:00
Kevin van Dijk 0e76652f28 refactor: kilo compat for v1.2.7 2026-02-23 18:48:59 +01:00
Kevin van Dijk 3bbf043c25 Resolve merge conflicts 2026-02-23 14:00:54 +01:00
Kevin van Dijk 42ecd7bd95 refactor: kilo compat for v1.2.1 2026-02-23 13:59:45 +01:00
Luke Parker ee754c46f9 fix(win32): normalize paths at permission boundaries (#14738) 2026-02-23 12:05:21 +10:00
Erik Demaine 0042a07052 fix: Windows path support and canonicalization (#13671)
Co-authored-by: LukeParkerDev <10430890+Hona@users.noreply.github.com>
2026-02-23 10:10:27 +10:00
Erik Demaine a74fedd23b fix(desktop): change detection on Windows, especially Cygwin (#13659)
Co-authored-by: LukeParkerDev <10430890+Hona@users.noreply.github.com>
2026-02-23 09:49:05 +10:00
Catriel Müller aac2685e92 Merge branch 'dev' into question-tool-description 2026-02-20 13:55:15 -03:00
Dax cb8b74d3f1 refactor: migrate from Bun.Glob to npm glob package (#14317) 2026-02-19 13:40:09 -05:00
Dax Raad af72010e9f Revert "refactor: migrate from Bun.Glob to npm glob package"
This reverts commit 3c21735b35.
2026-02-19 12:48:43 -05:00
Dax Raad 3c21735b35 refactor: migrate from Bun.Glob to npm glob package
Replace Bun.Glob usage with a new Glob utility wrapper around the npm 'glob' package.
This moves us off Bun-specific APIs toward standard Node.js compatible solutions.

Changes:
- Add new src/util/glob.ts utility module with scan(), scanSync(), and match()
- Default include option is 'file' (only returns files, not directories)
- Add symlink option (default: false) to control symlink following
- Migrate all 12 files using Bun.Glob to use the new Glob utility
- Add comprehensive tests for the glob utility

Breaking changes:
- Removed support for include: 'dir' option (use include: 'all' and filter manually)
- symlink now defaults to false (was true in most Bun.Glob usages)

Files migrated:
- src/util/log.ts
- src/util/filesystem.ts
- src/tool/truncation.ts
- src/session/instruction.ts
- src/storage/json-migration.ts
- src/storage/storage.ts
- src/project/project.ts
- src/cli/cmd/tui/context/theme.tsx
- src/config/config.ts
- src/tool/registry.ts
- src/skill/skill.ts
- src/file/ignore.ts
2026-02-19 12:34:18 -05:00
Dax 02a9495063 Remove use of Bun.file (#14215) 2026-02-19 11:32:32 -05:00
Dax Raad 568eccb4c6 Revert: all refactor commits migrating from Bun.file() to Filesystem module 2026-02-18 19:41:14 -05:00