Commit Graph

4365 Commits

Author SHA1 Message Date
kiloconnect[bot] c202ee34bb fix(cli): comment out proxy code instead of deleting it
Keep the original proxy code as comments rather than removing it,
making upstream merges easier and producing clearer merge conflicts.
2026-03-17 08:30:09 +00:00
kiloconnect[bot] 3dc6010dcb fix(cli): disable external proxy to app.opencode.ai
Disable the catch-all proxy route that forwards unmatched requests to
app.opencode.ai. This proxy served static assets from an external domain,
which raises privacy/security concerns as users' requests are sent to a
third-party host.

The catch-all route now returns a 404 instead of proxying. The proxy
import is commented out. Changes are marked with kilocode_change markers
to keep upstream merge diffs minimal.
2026-03-17 08:00:29 +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
John Brick 4c5bd13687 fix: use correct config.json schema URL (app.kilo.ai) (#7086)
The $schema URL in source code and documentation referenced
https://kilo.ai/config.json which returns 404. The correct URL
is https://app.kilo.ai/config.json (already used in test files).

Updated all remaining references in:
- packages/opencode/src/config/config.ts (4 occurrences)
- packages/kilo-docs/pages/code-with-ai/platforms/cli.md (4 occurrences)
- packages/kilo-docs/pages/customize/custom-subagents.md (1 occurrence)

Fixes #7063
2026-03-16 16:38:55 +00:00
Marius 88a55980e9 fix: guard temperature and prevent prompt injection in enhance-prompt (#7103)
* fix: use direct generateText for prompt enhancement instead of LLM.stream

* fix: guard temperature for models that disable it, move instruction to system message

- Check model.capabilities.temperature before setting temperature
- Move the enhance instruction to a system message to prevent user text
  from overriding the instruction via prompt injection
2026-03-16 16:21:27 +00:00
Mark IJbema b8e196d151 fix: also remove mode from legacy .kilocodemodes files used by ModesMigrator
Agent.remove() now also scans the .kilocodemodes YAML files that
ModesMigrator reads (VSCode global storage, ~/.kilocode/cli/global/,
~/.kilocodemodes, project .kilocodemodes) and removes the matching
entry by slug, so migrated modes don't reappear after deletion.
2026-03-16 16:01:19 +01:00
Mark IJbema 0b702ea1d7 feat: add backend route to delete custom mode files from disk
Replace the config disable:true approach with a proper Agent.remove()
function that scans config directories for the agent's markdown file
and deletes it, then refreshes state via Instance.dispose().

- Add Agent.remove() in agent.ts with RemoveError
- Add POST /kilocode/agent/remove route
- Mount KilocodeRoutes in server.ts
- Update KiloProvider to call the new backend route
- Regenerate SDK
2026-03-16 15:54:45 +01:00
Marius 91aa29ba83 fix: use direct generateText for prompt enhancement instead of LLM.stream (#7101) 2026-03-16 15:31:40 +01:00
Christiaan Arnoldus 7e69e22afe Merge pull request #7071 from Kilo-Org/revert-6629-fix/remove-duplicate-reasoning-hack
de-duplicate reasoning hack for OpenRouter
2026-03-16 15:04:52 +01:00
Mark IJbema bce8c6e6dd fix: validate skill location against registry before deletion and re-sync webview on failure 2026-03-16 13:43:34 +01:00
Christiaan Arnoldus 269fd052e3 Adjust for OpenRouter, some improvements 2026-03-16 13:36:10 +01:00
Mark IJbema cfe4e8c46c fix: switch skill removal to POST with JSON body instead of DELETE with query params
File paths as query parameters can fail due to URL encoding issues.
Switch to POST /kilocode/skill/remove with the location in the JSON
request body, which avoids encoding problems entirely.

Also log the SDK error response to aid debugging.
2026-03-16 13:04:07 +01:00
Mark IJbema 9507b01c4c fix: rely on optimistic removal instead of stale backend response
The DELETE endpoint was returning data that somehow rendered as empty
rows in the webview. Simplify the approach:

- Webview optimistically removes the skill from its signal immediately
- Extension fires DELETE to the backend (deletes from disk + cache)
- Extension invalidates cachedSkillsMessage so next tab visit fetches
  fresh data
- No second skillsLoaded message is sent after removal, avoiding the
  stale data overwrite that caused the UI corruption
2026-03-16 13:04:07 +01:00
Mark IJbema f998ee32dc fix: return updated skills list from DELETE endpoint to fix stale UI
The DELETE /kilocode/skill endpoint now returns the updated skills
list (Skill.Info[]) instead of a boolean. The extension uses this
response directly to update the webview, eliminating the need for a
separate GET /skill round-trip that could return stale cached data.

Also normalize paths in Skill.remove() with path.resolve() to ensure
location strings match regardless of path format differences.
2026-03-16 13:04:07 +01:00
Mark IJbema 2d9e447399 refactor: rename to KilocodeRoutes at /kilocode prefix
Rename routes/skill.ts to routes/kilocode.ts with KilocodeRoutes
export, mounted at /kilocode. This is the single home for all future
kilo-specific CLI endpoints, avoiding conflicts with the existing
/kilo gateway routes and keeping all kilo changes out of server.ts.

SDK: client.kilocode.removeSkill()
2026-03-16 13:04:07 +01:00
Mark IJbema 07d16dff23 refactor: move DELETE /skill to dedicated route file
Extract the inline DELETE /skill endpoint from server.ts into a
dedicated packages/opencode/src/server/routes/skill.ts file, reducing
kilo-specific changes in the shared server.ts and minimizing future
merge conflicts with upstream.

The route is mounted at /skill and uses the same lazy() pattern as
other kilo-specific route files (telemetry, enhance-prompt, etc.).
2026-03-16 13:04:07 +01:00
Mark IJbema ec544e8288 feat: add DELETE /skill endpoint and use CLI backend for skill removal
Add Skill.remove() that deletes the skill directory from disk and
mutates the cached Instance.state in-place so subsequent GET /skill
calls return the updated list.

Add DELETE /skill?location=... server endpoint, regenerate the SDK,
and update KiloProvider to call the SDK method instead of deleting
files directly from the extension.
2026-03-16 13:04:07 +01:00
Christiaan Arnoldus 971935f2a3 Revert "fix: remove duplicate reasoning hack for kilo provider" 2026-03-16 11:00:42 +01:00
Imanol Maiztegui 9e84e952ac Permissions: styling and tooltips (#7025)
* feat(kilo-vscode): Improved permission styling

* chore(kilo-vscode): Added translations for permission tooltips

* fix(kilo-vscode): Formatting

* chore: update kilo-vscode visual regression baselines

* feat(kilo-vscode): Improved border styles for permissions

* chore: update kilo-vscode visual regression baselines

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-13 16:19:24 +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 4e227ca318 Merge branch 'main' into kevinvandijk/kilo-opencode-v1.2.17 2026-03-13 13:55:22 +01:00
kilo-maintainer[bot] 702c27a8d2 release: v7.0.47 2026-03-13 12:45:52 +00:00
marius-kiloclaw 7473015ef9 fix(mcp-migrator): handle malformed JSON in legacy .kilocode/mcp.json (#7012)
readMcpSettings() called JSON.parse() without try/catch. In migrate(),
if .kilocode/mcp.json existed but contained malformed JSON, the uncaught
exception propagated out of the dual-read loop, preventing .kilo/mcp.json
from ever being read. The outer loadMcpConfig() catch returned {} instead
of the valid config — silently losing MCP server configuration.

Wrap the file read + parse in try/catch, log a warning, and return null
so the loop continues to the next config directory.

Regression tests added for both readMcpSettings (unit) and migrate
(integration) to prove the bug and verify the fix.

Refs: #6881

Co-authored-by: marius-kiloclaw <marius-kiloclaw@users.noreply.github.com>
2026-03-13 13:26:37 +01:00
Christiaan Arnoldus 24ff41a268 Apply suggestions from code review
Co-authored-by: Christiaan Arnoldus <christiaan.arnoldus@outlook.com>
2026-03-13 09:45:16 +01:00
Apoorv Saxena f24df95fee Merge branch 'main' into feat/inception-mercury2-reasoning-effort 2026-03-12 23:09:42 +05:30
Joshua Lambert d8511dcd28 Merge pull request #6772 from Kilo-Org/kilo-1773033860831
rebrand: replace OpenCode with Kilo in OAuth callback pages and auth metadata
2026-03-12 10:54:18 -04:00
Evgeny Shurakov 01a336fdfb fix(cli): guard against malformed JSON in import response 2026-03-12 14:07:13 +01:00
Evgeny Shurakov a0f6700cb1 fix(cli): respect KILO_SESSION_INGEST_URL in import command 2026-03-12 14:00:35 +01:00
Evgeny Shurakov 57dd8f8c25 fix(cli): restore Kilo share URL support in import command
The upstream merge (v1.1.54) overwrote Kilo-specific URL handling with
the opencode ShareNext flow, breaking import for app.kilo.ai/s/ URLs.

Restore parsing of https://app.kilo.ai/s/<id> and fetching from
ingest.kilosessions.ai instead of the opncd.ai share API.
2026-03-12 13:54:34 +01:00
Kevin van Dijk 6498fdaaa2 Merge branch 'main' into kevinvandijk/kilo-opencode-v1.2.17 2026-03-12 13:21:08 +01:00
Kevin van Dijk 3dc3af6a7d Re-add kilocode changes to refactored thread file 2026-03-12 13:14:05 +01:00
Marius 466644eb25 fix: use .kilo instead of .kilocode for config directories (#6881)
* fix: use .kilo instead of .kilocode for config directories

* fix: keep global ~/.kilocode untouched for legacy CLI compat

Only rename project-level .kilocode/ to .kilo/. The global ~/.kilocode
directory must stay because legacy CLI instances and legacy-migration.ts
in kilo-gateway still read from it.

* test: update VS Code extension tests to use .kilo directory paths

* fix: correct paths.ts comment and use specific git exclude entries

- Fix comment referencing ~/.kilo when globalDir() returns ~/.kilocode
- Revert to specific .kilo/ git exclude entries instead of blanket .kilo/
  to avoid hiding user-authored rules/workflows/config from git status

* fix: handle legacy per-worktree metadata and stale paths in state

- readMetadata() falls back to .kilocode/ inside worktrees since the
  per-worktree metadata dirs aren't renamed by the top-level migration
- Rewrite stale .kilocode/ paths in agent-manager.json on load

* fix: run .kilocode migration at extension activation, not just Agent Manager

Move migration call to the top of activate() so it runs for all users
on every extension startup, before kilo serve is spawned or any code
reads from the .kilo directory.

* fix: update git worktree refs after .kilocode → .kilo rename

After renaming the directory, git's internal .git/worktrees/*/gitdir
files still reference the old .kilocode path. This causes git to lose
track of worktrees, leading to crashes. Both the CLI and extension
migration now rewrite these gitdir files after a successful rename.

* fix: read from both .kilo and .kilocode, write to .kilo

Replace the one-time directory rename migration with a dual-read strategy:

- CLI config (rules, workflows, skills, MCP, project-id): read from both
  .kilo/ and .kilocode/ directories, with .kilo taking precedence
- Agent Manager data (worktrees, state, setup scripts): migrate from
  .kilocode/ to .kilo/ at startup since the extension exclusively owns these
- Config discovery (paths.ts, config.ts): include .kilocode in directory
  and agent/command pattern matching

Key decisions:
- .kilo/ is the new canonical write location for all new data
- .kilocode/ is read as a legacy fallback (no data loss for existing users)
- No directory rename: both dirs can coexist safely
- Agent Manager migration is item-level (moves individual files), not a
  full directory rename, so it handles both-dirs-exist gracefully
- Windows path rewrite in WorktreeStateManager handles both / and \ separators
- Workflow/MCP load order: .kilocode first, .kilo second (last wins)
- Rules dedup via seen-set with .kilo checked first (first wins)
- Delete migrate-kilo-dir.ts (no longer needed)

* fix: resolve .git file when fixing worktree refs during migration

When the project root is itself a worktree, .git is a file pointing
at the shared git dir, not a directory. Follow the gitdir pointer to
find the actual .git/worktrees/ location.

* fix: recover partial .kilo migrations and global dirs

Always repair stale git worktree refs when .kilo worktrees already exist so partially migrated repos recover on startup. Also dual-read global skills, rules, and workflows from both legacy and new home directories.

* fix: keep .kilo ahead of legacy config dirs

* fix: narrow legacy agent manager excludes

* chore: link migration cleanup follow-up
2026-03-12 12:50:28 +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
Imanol Maiztegui 60a7c7a9fd fix: run script/format.ts 2026-03-12 12:06:20 +01:00
Marius 2bca0ac9f1 feat(agent-manager): lazy-load worktree diff details (#6945)
* feat(agent-manager): lazy-load worktree diff details

* fix(agent-manager): remove unused diff helper

* fix(agent-manager): preserve summary diff accuracy

* fix(agent-manager): avoid stale diff summary targets

* perf(agent-manager): avoid rescanning diff details
2026-03-12 11:43:38 +01:00
Joshua Lambert a476b0bef7 Update packages/opencode/src/acp/agent.ts
Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com>
2026-03-12 00:10:46 -04:00
Joshua Lambert 09c3b8531c Merge branch 'main' into kilo-1773033860831 2026-03-11 23:34:02 -04:00
Kevin van Dijk 1147de8101 Merge branch 'main' into kevinvandijk/kilo-opencode-v1.2.16 2026-03-12 00:41:02 +01:00
kilo-maintainer[bot] b27f5832b4 release: v7.0.46 2026-03-11 14:40:06 +00:00
kilo-maintainer[bot] e8a8433c96 release: v7.0.45 2026-03-11 14:24:32 +00:00
Mark IJbema c29c48a5f6 Merge pull request #6910 from Kilo-Org/add-npm-readme
Add README for @kilocode/cli npm package
2026-03-11 12:16:51 +01:00
Mark IJbema 976939328d Merge branch 'main' into kevinvandijk/kilo-opencode-v1.2.16 2026-03-11 11:41:53 +01:00
kilo-maintainer[bot] a346c1f387 release: v7.0.44 2026-03-11 10:03:00 +00:00
kiloconnect[bot] f389066191 Remove kilo pr command from README 2026-03-11 09:30:45 +00:00
kiloconnect[bot] 8427ecbbf6 Fix README based on review feedback
- Fix npx command to use --package flag since package has multiple bins
- Remove undocumented autonomous mode (--auto) from Getting Started and Commands
- Remove kilo serve from Commands table (internal, not user-facing)
- Fix kilo session to show actual subcommands (list, delete)
- Remove kilo completion from Commands table (not working)
- Fix table formatting
2026-03-11 09:23:47 +00:00
Apoorv Saxena 636e665776 Merge branch 'main' into feat/inception-mercury2-reasoning-effort 2026-03-11 14:47:22 +05:30
Kevin van Dijk d4518c39ff Update packages/opencode/src/provider/error.ts
Co-authored-by: Catriel Müller <catrielmuller@gmail.com>
2026-03-11 09:58:07 +01:00
Kevin van Dijk d50aa1ae8c Merge branch 'main' into kevinvandijk/kilo-opencode-v1.2.16 2026-03-11 09:17:41 +01:00