Commit Graph
7457 Commits
Author SHA1 Message Date
Marius 335dd925fe Merge pull request #10669 from Kilo-Org/peppered-behavior
feat(cli): guide Agent Manager recall usage
2026-05-29 11:56:49 +02:00
Marius cf9b7ea421 Merge pull request #10715 from Kilo-Org/effect-permission-facade-10713
refactor(cli): remove Permission promise facade
2026-05-29 11:28:51 +02:00
Marius fd000ffadb Merge pull request #10718 from Kilo-Org/quaint-gate
docs: clarify shared snapshot guard scope
2026-05-29 11:21:42 +02:00
marius-kilocode e737fdda4a test(cli): remove runtime-coupled permission setup 2026-05-29 11:11:40 +02:00
marius-kilocode cd3dc7ed58 Merge remote-tracking branch 'origin/main' into effect-permission-facade-10713
# Conflicts:
#	script/check-opencode-promise-facades.ts
2026-05-29 11:07:27 +02:00
marius-kilocode 3dbf5f3454 test(cli): isolate Permission runtime boundaries 2026-05-29 11:05:54 +02:00
marius-kilocode 8dfa440c5c docs: clarify shared snapshot guard scope 2026-05-29 10:47:54 +02:00
marius-kilocode ff88d61175 refactor(cli): remove legacy Vcs facade 2026-05-29 09:57:41 +02:00
marius-kilocode e28cb43b7e refactor(cli): remove Permission promise facade 2026-05-29 09:55:59 +02:00
Imanol Maiztegui 8f225e2eec Remove wrappers for Provider service (#10658)
* refactor(opencode): remove legacy Provider promise wrappers in favor of Effect service usage

Replace static `Provider.list`, `Provider.getModel`, `Provider.getLanguage`,
`Provider.getSmallModel`, and `Provider.defaultModel` promise helpers with
direct `Provider.Service.use()` calls through `AppRuntime.runPromise`. This
eliminates the `makeRuntime` import and the wrapper functions that bypassed
the Effect dependency injection system.

- Remove legacy promise helpers from provider.ts
- Update kilo-sessions, roll-call, commit-message, enhance-prompt, and
  task tool to use Provider.Service via AppRuntime directly
- Thread Provider.Interface into KiloTask.select for proper DI
- Add Provider.defaultLayer to test layers that exercise TaskTool
- Update commit-message tests to spy on CommitMessageRuntime.model()

* docs(sdk): regenerate v2 SDK types and update edit endpoint description
2026-05-29 09:24:56 +02:00
kilo-maintainer[bot] 8882b523e3 release: v7.3.16 2026-05-28 21:19:11 +00:00
kilo-maintainer[bot] cd69bca8bf release: v7.3.15 2026-05-28 19:27:46 +00:00
Marius fba40377cb Merge pull request #10683 from Kilo-Org/effect-session-summary-facade-10677
refactor(cli): remove SessionSummary promise facade
2026-05-28 17:46:07 +02:00
Marius a3ef151b2a Merge pull request #10684 from Kilo-Org/effect-project-facade-10676
refactor(cli): remove Project promise facade
2026-05-28 17:45:25 +02:00
marius-kilocode 60051ea22a Merge remote-tracking branch 'origin/main' into effect-tool-registry-facade-10675 2026-05-28 17:10:13 +02:00
kilo-maintainer[bot] 13783d6f60 release: v7.3.14 2026-05-28 15:09:45 +00:00
marius-kilocode 2f49c6adbc refactor(cli): remove legacy ToolRegistry facade 2026-05-28 17:09:17 +02:00
marius-kilocode 977bf4ee39 refactor(cli): remove Project promise facade 2026-05-28 17:08:06 +02:00
marius-kilocode 16adbb6507 refactor(cli): remove SessionSummary promise facade 2026-05-28 17:07:53 +02:00
marius-kilocode 5b886f3a52 Merge origin/main into effect-storage-facade-10659 2026-05-28 16:25:08 +02:00
marius-kilocode 0107a0163c feat(cli): guide Agent Manager recall usage 2026-05-28 16:06:54 +02:00
marius-kilocode 3d3d68f37d refactor(cli): remove legacy Snapshot facade 2026-05-28 15:47:06 +02:00
marius-kilocode 02daf3aad0 refactor(cli): remove Storage promise facade 2026-05-28 15:45:51 +02:00
marius-kilocode d883ad96ab fix(cli): avoid indexing plugin blocking startup 2026-05-28 14:21:40 +02:00
Marius 7f35b6edb8 Merge pull request #10648 from Kilo-Org/serene-run
fix(cli): isolate semantic indexing in a worker
2026-05-28 11:48:44 +02:00
marius-kilocode 9fbd5479b0 fix(cli): isolate semantic indexing in a worker 2026-05-28 10:47:41 +02:00
Marius eef0983495 Merge pull request #10619 from Kilo-Org/free-alyssum
fix: constrain Kilo indexing embedding models
2026-05-28 09:37:28 +02:00
Mark IJbema aebca33df7 Merge pull request #10635 from Kilo-Org/add-agent-manager-json-to-gitignore
fix(cli): add agent-manager.json to default .kilo .gitignore
2026-05-28 09:23:45 +02:00
marius-kilocode 117691e4d6 fix: constrain Kilo indexing embedding models 2026-05-28 09:19:25 +02:00
Marius ac9f39fd6e Merge pull request #10618 from Kilo-Org/foil-fall
fix(cli): prevent stale global config reloads
2026-05-28 08:54:56 +02:00
kiloconnect[bot] 682e96aaf8 fix(cli): add agent-manager.json to default .kilo .gitignore 2026-05-27 21:21:56 +00:00
Mark IJbema 3bb55b3768 Merge pull request #10621 from Kilo-Org/mark/mercury-next-edit-integration-v2
Add Mercury Next Edit as an opt-in autocomplete mode
2026-05-27 17:15:57 +02:00
Mark IJbema ecd6db5204 fix(cli): correct next edit API description 2026-05-27 16:30:44 +02:00
Imanol Maiztegui 8bc05fa9f5 test(opencode): replace mock.module stubs with Effect layer injection in kilo tests (#10615)
Extract KiloModelsService from model-cache to enable dependency injection
and rewrite test files to use Layer-based test harnesses instead of
process-wide mock.module() calls that caused flaky cross-test pollution
on CI.
2026-05-27 15:42:15 +02:00
Imanol Maiztegui 1a36cfbb10 Effect Migration for Kilo callsites (follow-up 2) (#10616)
* refactor(opencode): remove raw LLM interface in favor of stream-based text helper

Introduce KiloLLM.text() to consume Effect streams and extract text
while propagating error/abort events. Replace all usages of the removed
LLM.raw() method and the legacy LLM.stream() async wrapper with
dedicated runtime helpers (CommitMessageRuntime.generate,
PlanFollowupRuntime.handover) that leverage the new stream-based
approach.

- Add KiloLLM.text() stream combinator in kilocode/session/llm.ts
- Remove Interface.raw and the exported LLM.stream() async function
- Refactor commit-message generation to use CommitMessageRuntime
- Refactor plan-followup handover to use PlanFollowupRuntime.handover
- Update all test LLM mocks to remove raw() stubs
- Add unit tests for KiloLLM.text() covering text joining, error
  propagation, and abort handling

* feat(skill): migrate Skill module to Effect service pattern and remove legacy promise wrappers

Remove the makeRuntime-based promise helpers (Skill.all, Skill.get,
Skill.dirs) from the skill module and convert the builtin-skills test
suite to use Effect generators with the testEffect harness.

- Delete legacy runPromise wrappers from packages/opencode/src/skill/index.ts
- Rewrite builtin-skills.test.ts to use testEffect and Effect.gen
- Replace WithInstance.provide/tmpdir with TestInstance yield pattern
- Use Skill.Service directly within Effect generators for all assertions

* refactor(session-status): drop makeRuntime promise helpers and wire Service through Effect context

Replace the standalone `SessionStatus.list`, `.get`, `.set` promise
wrappers with direct `SessionStatus.Service` usage via Effect generators
and `AppRuntime.runPromise` at Kilo callsites that remain imperative.

- Remove makeRuntime-based exports from session/status.ts
- Update kilo-sessions.ts and plan-followup.ts to use AppRuntime.runPromise
  with SessionStatus.Service
- Thread SessionStatus.Service as a dependency through SuggestTool and
  ToolRegistry layers
- Replace spy-based mocks in suggestion tool tests with an in-memory
  service stub for deterministic assertions
2026-05-27 15:42:09 +02:00
marius-kilocode dcfadac83e fix(cli): prevent stale global config reloads 2026-05-27 15:13:51 +02:00
Marius aec43e919c Merge pull request #10608 from Kilo-Org/simple-sushi
Enable Agent Manager tool by default in VS Code
2026-05-27 13:16:29 +02:00
marius-kilocode 3ffacc847b feat(agent-manager): enable tool by default in VS Code 2026-05-27 12:16:42 +02:00
Imanol Maiztegui 39a7305c97 Effect Migration for Kilo callsites (follow-up) (#10587)
* refactor(opencode): migrate ModelCache and Config to effect-native services

Remove legacy async wrapper functions from Config module and convert
ModelCache from a stateful namespace with module-level Maps into a
proper Effect service with Context/Layer semantics.

Key changes:
- Delete Config's `makeRuntime`-based async wrappers (get, getGlobal,
  update, warnings, etc.) — all callsites now use
  `Config.Service.use(...)` through AppRuntime
- Rewrite ModelCache as an Effect service with HttpClient dependency
  injection, replacing imperative Map-based caching with Effect-native
  Ref cells and TTL logic
- Convert KiloSessions.init and KilocodeBootstrap.init into proper
  Effect services with Layer-based dependency injection
- Wire ModelCache.Service into AppLayer, ProviderAuth, ModelsDev, and
  HTTP API handler layers
- Update Permission.layer to depend on Config.Service directly instead
  of calling Config async wrappers
- Add new test files for KiloSessions and ModelCache Effect integration
- Remove stale Config.get spyOn mocks from tests that no longer need
  them (experimental-session-list, recall)
- Fix indexing-auth to use typed IndexingConfig parameter instead of
  untyped record access

* fix(model-cache): resolve race conditions in concurrent fetch and cache invalidation

Introduce versioned cache cells with proper key derivation to prevent
stale responses from overwriting fresher data during concurrent fetches.

- Add version tracking to detect and discard outdated fetch results
- Derive cache keys from provider-specific options (baseURL, token, apiKey)
  to isolate concurrent requests with different credentials
- Make ModelCache.clear async to properly await invalidation across layers
- Update OrganizationDeps.clear signature to allow Promise<void> return
- Add concurrency and ordering tests for fetch/refresh race scenarios
- Rename local variable from `state` to `entry` in kilo-sessions sync loop

* chore(opencode): remove duplicate imports and fix test layer composition

Remove duplicate `AppRuntime` imports introduced during merge and update
kilo-sessions tests to use Effect-native Auth service instead of static
module calls.

- Remove duplicate `AppRuntime` import in index.ts and instance.ts
- Add Auth.defaultLayer to test layer helper
- Refactor test to yield Auth.Service and use instance methods
- Reorder Effect.provide/Effect.ensuring for correct resource cleanup

* style(opencode): normalize kilocode_change marker comments to block format

Standardize inline `// kilocode_change` annotations across source and
test files to use consistent `// kilocode_change start` / `// kilocode_change end`
block delimiters, improving readability and grep-ability of custom
modifications.
2026-05-27 11:43:32 +02:00
Mark IJbema ecbbe7faeb fix: remove noisy next-edit hot-path logs 2026-05-27 11:28:03 +02:00
Firas TrabelsiandClaude Opus 4.7 7437f77374 Move NES prompt templating to the gateway + wire FileIgnoreController
Addresses the two remaining points from @markijbema's review.

Prompt templating now lives in the gateway
-------------------------------------------
The Mercury sentinel-prompt assembly moved out of the VSCode extension
into packages/kilo-gateway/src/edit-prompt.ts. Clients now send
structured editor context (currentFileContent, cursor position,
editable region, recently-viewed snippets, edit-diff history) and the
gateway builds the sentinel-tagged prompt. This keeps the entire
Mercury contract — endpoint, auth, prompt format, response parsing — in
one place that VS Code, JetBrains, and the TUI can all share, instead
of each editor re-implementing the templating.

- New EditBody is the structured context (was: a pre-built `content`
  string). Updated the opencode HttpApi schema, the hono zod validator,
  both handlers, and regenerated the SDK.
- Deleted the VSCode-side mercuryPromptTemplate.ts (+ spec); the tests
  moved to packages/kilo-gateway/test/edit-prompt.test.ts.
- VSCode constants.ts now holds only the editable-region sizing; the
  sentinel tokens live in the gateway.

FileIgnoreController
--------------------
NES must not send ignored files (.env, secrets, anything matched by
.gitignore/.kilocodeignore) to the server. The NES provider now:
- skips the request entirely if the active document fails
  ignoreController.validateAccess(), and
- filters recently-viewed snippets through the same controller before
  they go into the prompt.
It reuses the classic provider's FileIgnoreController instance (now
public) rather than building a second one.

Also: dropped the implicit nextEdit.debug config read in log.ts (debug
is env-only via KILO_NES_DEBUG) so no VSCode autocomplete config is
added — per the "config should move to the backend" guidance.

Validation: typecheck clean across kilo-gateway, opencode, kilo-vscode;
lint clean; gateway 46 tests, vscode next-edit 10 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 17:04:07 -07:00
Firas TrabelsiandClaude Opus 4.7 ca2642438f Address review feedback: NES correctness, dedupe, tests
Two-agent review pass on the gateway-routed NES change. Fixes:

Correctness (🔴)
- MercuryEditProvider read the HTTP status off the parsed error body
  (`error.status`, always undefined), so 401/402 never reached
  onFatalError and NES had no credit-exhausted/auth backoff. Now reads
  `response.status` from the SDK result.
- NextEditSuggestionManager applied "insert" suggestions without the
  apply-time drift re-validation the "replace" path already had — edits
  between the anchor and insertion point could land the insert in the
  wrong place. Now re-checks the anchor line before inserting.
- The opencode Effect edit handler collapsed every upstream failure to
  HTTP 400; now passes the real status through (mirrors the FIM handler)
  so 401/402/429/5xx are distinguishable under the experimental backend.

Conciseness / DRY (🔴)
- Deleted dead module editCompletionParser.ts (+ spec): the gateway
  unwraps the fence server-side now, so the VSCode-side parser was unused.
- Hoisted the triplicated extractFencedBody into a single exported
  function in kilo-gateway/src/edit.ts; both the hono and Effect handlers
  import it. Added a shared EditUpstreamResponse type to replace three
  inline copies.

Robustness (🟡)
- extractFencedBody now keeps the body when the closing fence is missing
  (truncated/max_tokens output) instead of dropping the suggestion.
- EditHistoryTracker seeds snapshots on document open so the first edit
  in a freshly-opened file is captured (was previously dropped).
- Single-line inserts that span non-blank lines below the cursor (a
  multi-line→single-line collapse) now route to the decoration path
  instead of emitting a ghost item VSCode can't render.

Cleanup (🟡)
- Removed unused constants (MERCURY_EDIT_MODEL_ID, INCEPTION_API_BASE_URL,
  INCEPTION_EDIT_PATH).
- getProviderKey typed to DirectAutocompleteProviderID (matches FIM).
- resolveEditTarget keys on kind==="edit" defensively, so a future
  FIM-only Inception model can't resolve to the edit endpoint.
- AutocompleteModelDef doc comments made endpoint-neutral (not "FIM").
- Declared the internal accept command in contributes.commands.

Tests
- New packages/kilo-gateway/test/edit.test.ts: resolveEditTarget routing
  (incl. the mercury-edit-2 FIM model must NOT reach the edit endpoint)
  and extractFencedBody variants (lang tag, sentinels, truncation, blank
  lines, no-fence).
- typecheck clean across kilo-gateway, opencode, kilo-vscode; lint clean;
  all unit tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:14:29 -07:00
kilo-maintainer[bot] f68b778aa8 release: v7.3.12 2026-05-26 20:58:33 +00:00
kilo-maintainer[bot] 7598495eac release: v7.3.11 2026-05-26 20:02:42 +00:00
Firas TrabelsiandClaude Opus 4.7 fe60a467d1 Add Mercury Next Edit (NES) routed through the kilo gateway
Addresses @markijbema's architectural feedback on #10536: moves the HTTP
edit-completion call to the gateway, removes the standalone API-key
setting, and aligns with the provider/model selection design introduced
in #10559.

Wire-level changes
------------------
* New `/kilo/edit` endpoint added to the opencode HttpApi contract
  (`packages/opencode/src/kilocode/server/httpapi/groups/kilo-gateway.ts`)
  and mirrored into `packages/kilo-gateway/src/server/routes.ts` for the
  hono surface. SDK regenerated; `client.kilo.edit({ content, provider,
  model, maxTokens })` is now available.
* `packages/kilo-gateway/src/edit.ts` — `EditTarget` resolver mirroring
  the FIM pattern. Only the Inception provider is wired today (Mistral
  doesn't expose a comparable surface); Kilo Gateway has a placeholder
  branch that returns 400 until a server-side proxy exists.
* `packages/kilo-gateway/src/server/edit.ts` — `createEditHandler` reads
  the Inception BYOK key from `Auth.get("inception")` and falls back to
  `INCEPTION_API_KEY` from env, exactly like the FIM handler.
* The gateway unwraps Mercury's triple-backtick fence (and any
  `<|code_to_edit|>` sentinels) server-side so the VSCode response is
  just the rewritten code.
* `AutocompleteModelDef` gains an optional `kind: "fim" | "edit"`
  discriminator; new entry `inception/mercury-next-edit` (label "Mercury
  Next Edit") sets `kind: "edit"` and shares the wire model
  `mercury-edit-2`.

VSCode-side
-----------
* `MercuryEditProvider` no longer does its own HTTP — it's now a thin
  wrapper around `client.kilo.edit(...)` via `KiloConnectionService`.
* Dropped `kilo-code.new.autocomplete.nextEdit.apiKey` and
  `.nextEdit.baseUrl` settings. Auth and routing live in the gateway.
* The `AutocompleteServiceManager` dispatch now switches on the model's
  `kind` field (set by `getAutocompleteModel(provider, model)`) instead
  of string-comparing a model id, matching Mark's provider+model split.
* The `NextEditInlineCompletionProvider`,
  `NextEditSuggestionManager`, prompt template, parser, editable-region
  selector, edit-history tracker, recently-viewed-snippets adapter, and
  decoration-based jump-to-edit UX remain in the VSCode extension since
  they need editor-specific APIs (`InlineCompletionItem`,
  `TextEditorDecorationType`, keybinding context keys).

Bot review nits resolved
------------------------
* `INLINE_COMPLETION_ACCEPTED_COMMAND` renamed `kilocode.*` →
  `kilo-code.*` to match the project convention.
* `kilo-code.next-edit.acceptOrJump` and `.dismiss` now declared in
  `contributes.commands` so VS Code can resolve them in the palette.
* `disposeLog()` wired into `AutocompleteServiceManager.dispose()` so
  the dedicated "Kilo Code · Next Edit" OutputChannel doesn't leak.
* Per-keystroke "skip — no API key resolved" log removed (the entire
  API-key code path is gone).

Tests
-----
* `bun run check-types:extension` clean
* `bun run lint src` clean
* `bun test src/services/autocomplete/next-edit/__tests__/` — 23/23
  pass

Docs
----
* The partner walkthrough at
  `packages/kilo-vscode/docs/mercury-next-edit-testing.html` and the
  20-test playground under
  `packages/kilo-vscode/docs/nes-examples/` survive from the prior
  iteration. The walkthrough's "Install the PR locally" section still
  applies (the model dropdown choice is now "Mercury Next Edit
  (Inception)" — the API-key step is gone since BYOK is plumbed through
  the gateway's Auth store).

Known follow-ups (not in this commit)
-------------------------------------
* `FileIgnoreController` plumbing through the NES context builder so
  `.env`-style files don't get sent. Hook point identified in
  `NextEditInlineCompletionProvider.buildRequestContext`.
* Settings UI changes in the webview to expose Mercury Next Edit as a
  selectable provider/model pair alongside the FIM entries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 09:17:53 -07:00
kirillk 25b9007d3d Merge remote-tracking branch 'origin/main' into quaint-airbus
# Conflicts:
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt
#	packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionUiLayoutTest.kt
#	packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionUiTestBase.kt
2026-05-26 11:52:37 -04:00
Catriel Müller 2ebdbb2fe5 Merge pull request #10413 from LifeJiggy/clean/windows-cli-6307
fix(cli): make bash tool description Windows-aware
2026-05-26 11:53:25 -03:00
Marius 59762f5842 Merge pull request #10581 from Kilo-Org/uncovered-salary
feat(vscode): enable voice input for signed-in Kilo users
2026-05-26 16:16:09 +02:00
marius-kilocode 722eb44d63 feat(vscode): enable voice input for signed-in Kilo users 2026-05-26 15:45:48 +02:00
Catriel Müller 784c12ab3d refactor: keep platform as OS and added kilomarkers 2026-05-26 14:05:55 +01:00