Commit Graph

304 Commits

Author SHA1 Message Date
Johnny Eric Amancio be5f42f158 fix: support custom plan exit paths (#10952) 2026-06-06 00:50:58 +02:00
Christiaan Arnoldus b198441247 Merge pull request #10901 from Kilo-Org/fix/webfetch-unsupported-images
fix(cli): reject unsupported webfetch images
2026-06-05 10:56:13 +02:00
yanalialiuk 2d109462db Add Atomic Chat as a first-class local provider. (#10555)
* Add Atomic Chat as a first-class local provider.

Ship the atomic-chat plugin with auto-discovery on localhost:1337, register the provider in models.dev fixtures, and document setup for VS Code and CLI.

* Remove dead code

Removed atomicChat provider mapping from legacy migration.

* Update Atomic Chat provider icon to theme-colored vector.

Replace the embedded raster icon with a currentColor SVG symbol so it matches provider icon styling and inherits UI color consistently.

* Allow optional API key for local Atomic Chat and LM Studio providers.

Load the atomic-chat plugin despite named constant exports, register local-server auth in the plugin, and let CLI and VS Code connect with an empty key on localhost.

* Gate Atomic Chat discovery behind explicit opt-in

* Update packages/plugin-atomic-chat/src/utils/should-probe-atomic-chat.ts

* Remove dead branch in atomic-chat model ref probe.

Drop the modelID check (never equals provider key) and the duplicate providerID branch.

* Fix PR CI: register atomic chat plugin and complete i18n.

Restore atomic-chat in default-plugins after main merge, add missing sidebar locale keys, and annotate shared upstream diffs.

* Format i18n locale files and ProviderConnectDialog with Prettier.

* Address PR review: docs order, narrow annotations, plugin fixes.

Reorder local-models providers per maintainer feedback; use inline kilocode_change markers in dialog-provider. Share ModelStatusCache, fix config discovery abort/timeout, throw on fetch failure, and resolve bot review warnings.

* Align dialog-provider with upstream keymap bindings after rebase.

Restore useBindings instead of useKeyboard so shared-file diff stays minimal and passes annotation checks.

* Update packages/kilo-vscode/webview-ui/src/components/settings/ProviderConnectDialog.tsx

* Deduplicate Atomic Chat /v1/models fetch on config discovery.

Use a single shared models endpoint request in enhanceConfig instead of separate health and discovery calls.

* Fix kilo-code-bot review: import provider key and log cache errors.

Export ATOMIC_CHAT_PROVIDER_KEY from local-providers for the webview, log cache warm failures, and throw on network errors in fetchModelsEndpoint.

* fix(plugin-atomic-chat): harden discovery and reduce chat toasts

Reuse auto-detect model list to avoid duplicate /v1/models calls, wire AbortSignal into fetch, replace silent catches with logging, and only surface validation errors in chat.params.

* fix(plugin-atomic-chat): refresh model cache on chat validation retries

Bypass the 15s model list cache after the first failed attempt so retryWithBackoff can observe newly loaded models.

* Update packages/plugin-atomic-chat/src/utils/index.ts

* fix(plugin-atomic-chat): repair categorizeError not_found branch

Restore return statement and map "not loaded" validation errors to not_found after bot commit broke the if block.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com>
2026-06-04 16:03:00 +02:00
chrarnoldus 714f920b1e fix(cli): report unsupported icons as tool errors
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
2026-06-04 12:43:30 +00:00
chrarnoldus 1a1c0bd86a fix(cli): narrow webfetch image rejection
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
2026-06-04 10:45:51 +00:00
chrarnoldus a8a8dd8724 fix(cli): reject unsupported webfetch images
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
2026-06-04 08:30:11 +00:00
marius-kilocode aeef0df2f9 resolve merge conflicts 2026-06-02 16:13:31 +02:00
marius-kilocode 4472e6d769 refactor: kilo compat for v1.14.46 2026-06-02 13:51:23 +02:00
marius-kilocode 0f271a39d7 resolve merge conflicts 2026-06-01 15:20:54 +02:00
marius-kilocode 7cc6080646 refactor: kilo compat for v1.14.42 2026-06-01 12:51:31 +02:00
Imanol Maiztegui e4c9b4363e refactor(session): replace promise facade helpers with Effect service calls (#10731)
Migrate all Session.* promise-based helper usage (create, get, messages,
updateMessage, updatePart, setPermission, children, fork) to direct
Effect service consumption via Session.Service. This eliminates the
makeRuntime-backed legacy promise wrappers from session.ts and updates
all dependent modules and tests to use the Effect-based interface.

Key changes:
- Remove exported promise helpers (create, get, messages, etc.) from
  session/session.ts along with the module-level makeRuntime instance
- Update kilo-sessions, remote-sender, allow-everything permission,
  plan-followup, recall tool, and fork module to yield Session.Service
- Convert remapChildren from async function to Effect generator
- Add PlanFollowupRuntime.session helper for effectful session access
- Update all affected test files to use Effect.runPromise with
  Session.Service.use pattern
- Remove session/session.ts from the promise facade allowlist and
  update test allowlist counts accordingly
2026-05-29 16:19:15 +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
marius-kilocode 2f49c6adbc refactor(cli): remove legacy ToolRegistry facade 2026-05-28 17:09:17 +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
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
Imanol Maiztegui bacfa4ae62 Effect Migration for Kilo callsites (#10572)
* refactor(opencode): migrate agent promise helpers to kilocode module and adopt Effect-based tests

Remove legacy promise-based helpers (`get`, `list`, `defaultAgent`, `remove`)
from the core agent module and update callsites to use the dedicated
`@/kilocode/agent` module directly. Migrate kilocode-specific tests from
`WithInstance.provide` patterns to the `testEffect` helper with Effect
generators for cleaner, more idiomatic test code.

- Remove `makeRuntime` import and exported promise helpers from agent.ts
- Update HTTP API handlers to import from `@/kilocode/agent` instead of
  re-exported `Agent` namespace
- Rewrite agent tests to use `load()` helper or Effect service access
- Convert agent-global-config-dirs and agent-skill-permissions tests to
  `testEffect` pattern
- Reorder SDK type definitions (BackgroundProcessLogs/WorkspaceWarpError)

* chore(auth): remove legacy promise helpers and replace with direct Effect service access

Eliminate the exported promise-based convenience functions (`get`, `all`,
`set`, `remove`) from the Auth module and replace all callsites with
explicit `AppRuntime.runPromise` or `makeRuntime` invocations that access
`Auth.Service` directly through Effect's service pattern.

- Delete `makeRuntime`-backed promise helpers from auth/index.ts
- Update CLI entrypoint, kilo-sessions, indexing, and server instance to
  use `AppRuntime.runPromise(Auth.Service.use(...))` for auth access
- Inject `Auth.Service` as a dependency into the ModelsDev layer and
  consume it via Effect generator instead of promise wrapper
- Create a local `makeRuntime` instance in model-cache.ts for non-Effect
  callsites that still need promise-based auth access
- Rewrite tests to manipulate auth.json directly on disk with proper
  save/restore semantics instead of relying on removed helpers

* refactor(suggestion): convert suggest tool to Effect-native with injected Command dependency

Transform the suggestion tool from async/promise-based implementation to
idiomatic Effect generators with explicit dependency injection of the
Command service rather than importing and calling module-level helpers.

- Convert `resolvePrompt` from async function to Effect generator that
  accepts a `Command.Interface` parameter
- Refactor `SuggestTool` definition to yield `Command.Service` from the
  Effect context and thread it through to `resolvePrompt`
- Add `Command.Service` as a dependency to the tool registry layer and
  provide `Command.defaultLayer` in both production and test wiring
- Remove unused `makeRuntime` import and exported `get` helper from
  command/index.ts
- Add explicit type annotations to Auth delegate in server instance
- Rewrite suggestion tests to use `testEffect` helper with a mock
  `Command.Service` layer instead of spying on module exports

* feat(git): migrate WorktreeFamily to Effect service and wire Git.Service as dependency

Convert WorktreeFamily.list from an async function using legacy promise
helpers to an Effect generator that yields Git.Service from context,
eliminating the need for the removed `run` promise wrapper in git/index.

- Replace `WorktreeFamily.list()` async function with Effect.fn generator
  that obtains Git.Service and InstanceState from the Effect context
- Remove legacy `makeRuntime`/`run`/`runPromise` exports from git module
- Update RecallTool to thread Git.Service through to WorktreeFamily calls
  via EffectBridge
- Add Git.Service as a required dependency in tool registry and HTTP
  server route layers
- Update all test layers to provide Git.defaultLayer

* chore(mcp): replace legacy promise helpers with Effect-native AppRuntime calls

Remove exported promise-based `status`, `connect`, and `disconnect`
helpers from MCP module and convert the network recovery callsite in
SessionNetwork to use AppRuntime.runPromise with Effect.gen directly.

* refactor(auth): adopt makeRuntime helper for Auth service resolution in kilo modules

Replace AppRuntime.runPromise with locally scoped makeRuntime instances
in kilo-sessions and kilocode/indexing modules, removing the dependency
on the global AppRuntime singleton for Auth service access.

* fix(test): simplify cleanup error handling in provider test

Replace try-catch block with promise .catch() for file unlink operation
during test teardown.
2026-05-26 12:51:21 +02:00
marius-kilocode a416b40273 Merge remote-tracking branch 'origin/main' into fix-subagent-error-recovery
# Conflicts:
#	packages/opencode/src/tool/task.ts
#	packages/opencode/test/tool/task.test.ts
2026-05-26 10:42:07 +02:00
Imanol Maiztegui 913d6cb07b fix(opencode): correct provider ID references and update TaskPromptOps cancel signature
Use providerID variable instead of provider.id in dialog-provider to
fix incorrect property access after destructuring. Update cancel method
in TaskPromptOps stubs to return Effect.void matching the expected
interface. Remove obsolete workspace-restore test file and add missing
fixture import.
2026-05-22 12:27:18 +02:00
Imanol Maiztegui 7b94fbb95b style: format code with prettier across multiple packages
Reformat multiline arrays, JSX props, CSS transitions, and test
indentation to comply with the project's prettier configuration.
Also reorder auto-generated SDK type imports alphabetically and
relocate type definitions to match updated openapi.json output.
2026-05-22 11:58:24 +02:00
Imanol Maiztegui b6523c0d91 resolve merge conflicts 2026-05-22 09:01:40 +02:00
Imanol Maiztegui f7816a9eeb refactor: kilo compat for v1.14.41 2026-05-21 14:48:36 +02:00
marius-kilocode 2caa5489f2 chore(cli): annotate task failure test import 2026-05-21 14:15:50 +02:00
marius-kilocode 7025c779f7 fix(cli): surface failed subagent task errors 2026-05-21 14:15:04 +02:00
Imanol Maiztegui f9679c4771 Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.14.34 2026-05-19 15:56:46 +02:00
Imanol Maiztegui ad00b1461d refactor(kilocode): decouple provider-auth lifecycle, add cloud-fork CLI option, and migrate indexing config to Effect Schema
Extract `disposeAllInstancesAfterProviderAuthCallback` into a dedicated
module and invoke it from the provider OAuth callback handler instead of
coupling it to the ProviderAuth layer. This removes the InstanceStore
dependency from `ProviderAuth.layer`.

Additional changes:
- Add `--cloud-fork` CLI option to the run command for fetching sessions
  from cloud and continuing locally
- Replace the Zod-bridged `Schema.Any` indexing config with a native
  Effect `IndexingSchema` definition in kilo-indexing, propagating typed
  config through the SDK OpenAPI spec
- Use `optionalOmitUndefined` for `recommendedIndex` to emit clean JSON
- Fix `request.source.signal` access by guarding with `instanceof Request`
- Replace `Effect.catchAllCause` with `Effect.catchCause` in telemetry
- Migrate tests from `BashTool` to `ShellTool`, extract `TestConfig`
  fixture, and convert stats-subagent-cost tests to use `testEffect`
- Reorder SDK event union members to match updated OpenAPI schema
- Export `aggregateSessionStats` for Kilo regression test coverage
- Widen `setViewedSessions` input to accept readonly arrays
2026-05-19 13:09:03 +02:00
Imanol Maiztegui 128df55d6b fix(opencode): migrate Instance.provide calls to WithInstance.provide
Replace direct `Instance.provide` usage with `WithInstance.provide` across
source modules and test files to decouple runtime context provisioning
from the core Instance singleton.

- Update kilo-sessions, remote-sender, roll-call, and plan-followup source
- Remove unused `Instance` imports where only `WithInstance` is needed
- Drop unnecessary `init` param from indexing-worktree test calls
- Add missing `WithInstance` import in fixture-dependent test files
2026-05-18 18:32:30 +02:00
Imanol Maiztegui e68fd6781d resolve merge conflicts 2026-05-15 13:13:17 +02:00
Imanol Maiztegui b7a7ecf449 refactor: kilo compat for v1.14.34 2026-05-15 09:25:13 +02:00
Kirill Kalishev 9c554f0330 Merge branch 'main' into ionized-emmental 2026-05-11 12:55:04 -04:00
Marius 33a233fd11 fix(cli): prevent nested subagent delegation (#10137) 2026-05-11 15:13:08 +02:00
kirillk 931b803068 test(cli): update QuestionOption wire-shape snapshot to include mode field 2026-05-09 22:16:53 -04:00
Mark IJbema 1ea9ad2af0 resolve merge conflicts 2026-05-06 21:32:26 +02:00
Mark IJbema a77843cbab refactor: kilo compat for v1.14.33 2026-05-06 12:13:06 +02:00
Mark IJbema 1ba2980cad resolve merge conflicts 2026-05-05 15:11:52 +02:00
Mark IJbema 2701776e21 refactor: kilo compat for v1.14.30 2026-05-05 12:50:48 +02:00
Kit Langton 4c4860fb24 Replace Instance.disposeAll/load with fixture helper (#25418) 2026-05-02 10:56:15 -04:00
Zeke Sikelianos 51e310c9ce fix(read): prevent unsupported image formats from being sending to provider (#21114)
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
2026-05-01 18:14:22 -05:00
Mark IJbema 5d5fab36bb fix(cli): repair broken imports and typecheck after opencode v1.14.29 merge
Fixes 257 typecheck errors surfaced after the upstream merge:

- Update imports to new module paths after upstream PR #24554 removed
  module barrel files (@/config, @/session, @/util, etc.) and PR #24309
  renamed @opencode-ai/shared to @opencode-ai/core.
- Migrate loadMode to use Info.zod.safeParse for consistency with
  loadAgents and ConfigCommand (unblocks KilocodeConfig.handleInvalid).
- Drop removed Npm.outdated mock from tests.
- Add missing Config.defaultLayer to bash-permission-metadata test runtime.
- Fix Tips component signature (kilocode drops upstream's 'connected' prop).
- Fix toast.tsx undefined 'duration' reference (should be toastOptions.duration).
- Move filesystem-containment test from deleted shared package to core.
2026-04-30 17:16:31 +02:00
Mark IJbema 3f7037549e resolve merge conflicts 2026-04-30 16:25:46 +02:00
Aiden Cline 6aa8e894b1 chore: rm broken codesearch tool (#24992) 2026-04-29 13:15:44 -05:00
Mark IJbema 7d375b93ee refactor: kilo compat for v1.14.29 2026-04-29 17:24:20 +02:00
Kit Langton 6015084fa2 Prepare Effect HttpApi backend parity (#24853) 2026-04-29 09:34:50 -04:00
Dax f25f1485d5 refactor: remove module barrels (#24554) 2026-04-27 14:33:33 -04:00
Imanol Maiztegui 0573557092 test(opencode): update tool parameter snapshots and assertions for schema changes
Refresh JSON Schema snapshots and adjust unit tests to reflect recent
schema modifications in the opencode tool definitions.

- Mark bash `description` field as optional and update its prefix text
- Add i18n key fields (headerKey, questionKey, labelKey, descriptionKey)
  to the question tool snapshot
- Flip bash parameter test from rejecting to accepting missing description
- Remove stale blank line in snapshot file
2026-04-27 19:41:11 +02:00
Imanol Maiztegui fd8818e48c resolve merge conflicts 2026-04-27 15:57:16 +02:00
Imanol Maiztegui 108dfe3238 refactor: kilo compat for v1.14.23 2026-04-27 13:56:08 +02:00
Alex Alecu aaaa191b76 fix(cli): include subagent costs in session total (#6321)
When a session spawned subagents via the task tool, the displayed cost reflected only the parent's own LLM steps. Propagate each subagent's total up to the invoking assistant message so every UI sums the full tree.
2026-04-27 13:14:10 +02:00
Luke Parker 8718b98ee1 fix: pass workspace symbol query to experimental LSP tool (#24576) 2026-04-27 05:39:36 +00:00
Luke Parker 141f33d24b feat: configurable shell selection + desktop settings UI (#20602) 2026-04-27 00:54:55 +00:00
Dax Raad 1e98167b0e core: move cross-spawn-spawner to root and remove unused types
The cross-spawn-spawner module has been moved from src/effect/ to src/
to simplify the core package structure. The src/types.d.ts file which
contained unused type declarations has also been removed. All imports
throughout the codebase have been updated to reflect the new location.

This change reduces the package's internal complexity by flattening the
module hierarchy and removing dead code, making future maintenance easier.
2026-04-25 14:30:16 -04:00