Commit Graph

516 Commits

Author SHA1 Message Date
Imanol Maiztegui 0adb514da4 Remove allow always button (#7159)
* feat: save permissions to config

* fix: preserve wildcard default in jsonc scalar promotion and skip dispose for permission saves

* fix: update CLI permission hint to reflect permanent persistence

* fix: avoid mutating input in mergeConfig permission normalization

* chore: update kilo-vscode visual regression baselines

* fix(vscode): remove Allow Always button from PermissionDock

* fix(kilo-vscode): removed unreachable onDecide option

* chore: update kilo-vscode visual regression baselines

* fix: scope patchJsonc scalar promotion to permission keys only

* fix: toConfig always uses object format to preserve existing granular rules

* fix: preserve metadata.rules order in saveAlwaysRules for correct precedence

* feat:show non-bash tool permissions on dropdown

* fix: include always patterns in saveAlwaysRules validation loop

* test(kilo-vscode): remove write mixed-decisions screenshot test for single-rule dropdown

* test: updated visual tests

* fix: formatting

* chore: update kilo-vscode visual regression baselines

* fix: use scalar format in toConfig for PermissionAction-only permissions

* fix: serialize scalar-only permissions as scalars for all patterns

* fix: skip non-wildcard patterns for scalar-only permissions in toConfig

* fix: promote doom_loop to PermissionRule for per-tool persistence

* fix: keep doom_loop as PermissionAction and skip non-wildcard scalar-only patterns in toConfig

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-17 18:44:04 +01:00
Imanol Maiztegui 28330ea765 Save permission rules to config (#7143)
* feat: save permissions to config

* fix: preserve wildcard default in jsonc scalar promotion and skip dispose for permission saves

* fix: update CLI permission hint to reflect permanent persistence

* fix: avoid mutating input in mergeConfig permission normalization

* chore: update kilo-vscode visual regression baselines

* chore: update kilo-vscode visual regression baselines

* fix: scope patchJsonc scalar promotion to permission keys only

* fix: toConfig always uses object format to preserve existing granular rules

* fix: preserve metadata.rules order in saveAlwaysRules for correct precedence

* fix: remove unnecessary dispose con config global update

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-17 15:59:52 +01:00
Catriel Müller 36210fa6d1 resolve merge conflicts 2026-03-16 20:33:36 -03:00
Catriel Müller e6b29e3ead feat: merge opencode v1.2.19 2026-03-16 19:37:22 -03: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
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
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
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
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
Kevin van Dijk d50aa1ae8c Merge branch 'main' into kevinvandijk/kilo-opencode-v1.2.16 2026-03-11 09:17:41 +01:00
Apoorv Saxena a9179c5a3b fix: use mercury-2 model ID in tests instead of mercury-2-coder
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 09:58:39 +05:30
Apoorv Saxena 0fe2e3ebef fix: remove instant reasoning effort for mercury-2 on kilo gateway and direct inception
Instant effort is not suitable for tool calling scenarios. Removed from
@ai-sdk/openai-compatible (direct inception) and updated kilo gateway
test to reflect server no longer providing instant variant. OpenRouter
keeps all OPENAI_EFFORTS unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 23:39:33 +05:30
Apoorv Saxena 8a94d1b55d feat: add reasoning effort support for Inception Mercury-2
Add Mercury-2 reasoning effort variants for OpenRouter and Inception
direct API providers. OpenRouter gets OPENAI_EFFORTS (none through
xhigh), Inception gets instant + WIDELY_SUPPORTED_EFFORTS. Kilo
Gateway already works via server-provided variants.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:39:29 +05:30
Catriel Müller d5de298cb8 fix: permission config string to object update 2026-03-10 00:32:50 -03:00
Josh Holmer 73c0d924ed fix(cli): save and load per-agent model selection 2026-03-09 11:51:46 -04:00
Catriel Müller 3b535cf5aa feat: migrate .opencode project folder to .kilo 2026-03-09 11:19:57 -03:00
Kevin van Dijk 312733ebd6 Resolve merge conflicts 2026-03-09 13:02:22 +01:00
Kevin van Dijk 2d33025ecb refactor: kilo compat for v1.2.16 2026-03-09 11:31:51 +01:00
Imanol Maiztegui 2d5f8a256c fix: Moved kilocode specific code to kilocode folder 2026-03-06 21:15:18 +01:00
Imanol Maiztegui ec0e0bf5ed feat: Better messages for auth required errors 2026-03-06 20:29:54 +01:00
Imanol Maiztegui ac4cfd329b fix: Add unit test and review bot fixes 2026-03-05 13:21:00 +01:00
Mark IJbema ee8daf6907 Merge pull request #6599 from Kilo-Org/mark/remove-kilocode-change-markers
Remove kilocode_change markers from kilo-specific packages
2026-03-04 11:55:29 +01:00
Mark IJbema e97348d7aa Remove kilocode_change markers from kilo-specific packages
These markers are only needed in shared upstream opencode files to prevent
merge conflicts. In kilo-specific packages (kilocode/, kilo-gateway/,
kilo-ui/, kilo-i18n/, kilo-vscode/, etc.) they serve no purpose.
2026-03-04 11:39:53 +01:00
Christiaan Arnoldus aec01330ea Merge branch 'main' into session/agent_f767ec1f-7980-4b5e-b27d-74befa652e5e 2026-03-04 10:06:21 +01:00
James Long 7f37acdaaa feat(core): rework workspace integration and adaptor interface (#15895) 2026-03-03 21:35:38 -05:00
Matt Silverlock 74ebb4147f fix(auth): normalize trailing slashes in auth login URLs (#15874) 2026-03-03 13:35:49 -05:00
Igor Šćekić e5bfdfd829 Merge pull request #6565 from Kilo-Org/fix/ask-mode-edits 2026-03-03 18:07:38 +01:00
Igor Šćekić d8dacd6bb4 test: assert specific-path edit is denied in ask mode 2026-03-03 17:27:50 +01:00
Igor Šćekić 50227192dd fix: ask mode respects user permission config for edit tools
Move the ask agent's deny+allowlist after user config in the merge
order so ask mode's restrictions always win. Previously, user global
permission config (e.g. edit: { 'src/log.ts': 'allow' }) was appended
last, causing PermissionNext.disabled() to stop at the user's specific-
pattern rule and leave edit/write/bash in the LLM's tool list.

Fixes #6235
2026-03-03 16:30:44 +01:00
kiloconnect[bot] cdac0d8dab feat(kilo-gateway): add KILOCODE_VERSION support to editor header
- introduce ENV_VERSION constant in kilo-gateway and export it
- modify getEditorNameHeader to append version when provided
- export ENV_VERSION from gateway index for external use
- initialize ENV_VERSION from Installation.VERSION in opencode startup
- update tests to verify editor header with and without version
2026-03-03 15:18:42 +00:00
Catriel Müller 5aa6dcb8ea Merge branch 'main' into docs/clarify-kilo-install-artifact 2026-03-03 10:36:33 -03:00
Mark IJbema 3f4b8e90c6 Merge pull request #6527 from Kilo-Org/mark/enhance-prompt
feat(vscode): Enhance Prompt —  sparkle button to improve prompts before sending
2026-03-03 14:03:32 +01:00
Marius 15c7b6a61e Fix agent interrupt AbortError leak (#6554) 2026-03-03 09:35:51 -03:00
Mark IJbema 6f9a0f0c5a feat(vscode): Enhance Prompt — sparkle button to improve prompts before sending
Add the Enhance Prompt feature to the VS Code extension, matching the
legacy extension's behaviour. A  sparkle button in the chat input
toolbar rewrites the user's draft prompt using an LLM.

CLI:
- POST /enhance-prompt endpoint using LLM.stream with small model
- System prompt as agent.prompt for caching; user text as user message
- clean() strips code fences and surrounding quotes from LLM output

Extension:
- KiloProvider handler using SDK client.enhancePrompt.enhance()
- Shows VS Code error notification on failure
- WandSparkles icon from lucide-solid via @kilocode/kilo-ui
- Spin animation while enhancement is in flight
- Empty-input click shows feature description (all 16 i18n locales)
- Ctrl+Z / ⌘Z undo restores original draft
- Guard checks isBusy/isDisabled/enhancing matching canEnhance()

Tests:
- 11 unit tests for clean() in enhance-prompt.test.ts

Migration plan:
- Removed feature row (parity achieved)
- Deleted prompt-improvement.md spec doc
2026-03-03 13:21:45 +01:00
Evgeny Shurakov 3dbc3a3605 fix: bootstrap session ingest after import 2026-03-03 12:44:11 +01:00
Shoubhit Dash 7e3e85ba59 fix(opencode): avoid gemini combiner schema sibling injection (#15318) 2026-03-03 10:11:05 +05:30
opencode-agent[bot] e41b53504f chore: generate 2026-03-03 03:53:50 +00:00
Ryan Skidmore 96d6fb78da fix(provider): forward metadata options to cloudflare-ai-gateway provider (#15619) 2026-03-02 22:53:03 -05:00
Ryan Skidmore fd6f7133c5 fix(opencode): clone part data in Bus event to preserve token values (#15780) 2026-03-02 22:52:43 -05:00
sonwr d7c2660bb5 test(cli): guard npm-dependent install artifact test 2026-03-03 12:33:37 +09:00
sonwr bf98912d03 test(cli): clean up temp install artifact fixture 2026-03-03 12:00:47 +09:00