Commit Graph

231 Commits

Author SHA1 Message Date
Imanol Maiztegui 9c182afcd0 fix(providers): enforce provider ID matching to isolate custom configurations
Provider plugins (llmgateway, nvidia, openrouter, vercel, zenmux) now
verify the provider ID before applying attribution headers, preventing
custom-defined providers sharing the same endpoint URL from being
mutated by built-in plugin logic.

Additional changes:
- Add auth-v2.json migration path for multi-account store continuity
- Remove obsolete @ai-sdk/xai patch and ConsoleCommand registration
- Add native LLM session recordings for anthropic, openai-oauth, and zen
- Update CLI help snapshots to reflect Kilo branding
- Expand i18n with usage-exceeded dialog strings (it, nl, uk)
2026-06-17 19:11:26 +02:00
Imanol Maiztegui d2162d868a fix(opencode): remove duplicate import in httpapi-sdk test 2026-06-17 14:05:00 +02:00
Imanol Maiztegui 27d19a8deb Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.15.9 2026-06-17 14:03:20 +02:00
Imanol Maiztegui b37a546450 resolve merge conflicts 2026-06-17 10:42:43 +02:00
Catriel Müller e17cab995e fix: kilo markers 2026-06-16 00:45:53 -03:00
Catriel Müller 339513190e fix: fix tests 2026-06-16 00:15:21 -03:00
Catriel Müller 3ba0de1fc6 refactor: regenerate sdk 2026-06-15 21:42:35 -03:00
Catriel Müller 0c0b95fac6 fix: fix tests 2026-06-15 21:27:50 -03:00
Catriel Müller e91eef2b38 fix: session list on tui 2026-06-15 21:08:16 -03:00
Catriel Müller 0675b201b7 refactor: fix markers 2026-06-15 17:32:32 -03:00
Catriel Müller 8b5261d2f1 fix: test 2026-06-15 17:12:55 -03:00
Imanol Maiztegui 5b9e33cfef refactor: kilo compat for v1.15.9 2026-06-15 14:48:05 +02:00
marius-kilocode 06e87cf653 fix: resolve OpenCode v1.15.4 merge regressions 2026-06-12 19:45:14 +02:00
marius-kilocode 76518dd24f Merge origin/main into OpenCode v1.15.4 2026-06-12 16:19:19 +02:00
Catriel Müller a4952b0836 fix: fix tests 2026-06-11 14:19:49 -03:00
marius-kilocode 72a11b02af resolve merge conflicts 2026-06-10 20:03:42 +02:00
marius-kilocode 00554bd24c refactor: kilo compat for v1.15.4 2026-06-10 17:38:09 +02:00
marius-kilocode fd6fd50236 fix(cli): stabilize file search and event tests 2026-06-09 12:46:32 +02:00
marius-kilocode 27d2c148d0 fix: complete OpenCode v1.14.51 integration 2026-06-09 11:53:08 +02:00
marius-kilocode 1d23dc2171 resolve merge conflicts 2026-06-09 10:17:21 +02:00
marius-kilocode 6ecaaab48a refactor: kilo compat for v1.14.51 2026-06-09 08:29:02 +02:00
marius-kilocode cc03ffc581 fix: harden OpenCode v1.14.48 integration 2026-06-08 14:38:13 +02:00
marius-kilocode 5706abce76 chore(cli): normalize upstream annotations 2026-06-08 12:45:47 +02:00
marius-kilocode cf08de3f44 resolve merge conflicts 2026-06-08 12:04:21 +02:00
marius-kilocode e610b1d390 refactor: kilo compat for v1.14.48 2026-06-08 10:58:10 +02:00
marius-kilocode ce3851f5bd Merge remote-tracking branch 'origin/main' into marius-kilocode/kilo-opencode-v1.14.46
# Conflicts:
#	packages/opencode/src/kilocode/session/processor.ts
#	packages/opencode/src/server/routes/instance/httpapi/groups/session.ts
#	packages/opencode/src/session/processor.ts
#	packages/opencode/src/session/prompt.ts
2026-06-02 19:49:05 +02:00
marius-kilocode e64c1fb65e fix(cli): restore bodyless session forks 2026-06-02 18:41:57 +02: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 b5213921c1 fix: preserve Kilo identity after upstream merge 2026-06-01 16:58:26 +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 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
kirillk 936bb25f2a test(cli): annotate Windows skip call sites 2026-05-25 11:30:54 -04:00
kirillk 4c90e6f03b test(cli): skip Windows-incompatible opencode tests 2026-05-25 11:28:07 -04: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
Imanol Maiztegui 8d9c12e5a4 fix(opencode): replace InstanceLayer.layer with explicit dependencies in instance context test
Avoid InstanceLayer.layer's lazy bootstrap import in the test graph by
directly providing InstanceStore.defaultLayer with InstanceBootstrap.defaultLayer,
preventing unintended side effects during test execution.
2026-05-20 12:34:20 +02:00
Imanol Maiztegui 32777136cd fix(opencode): resolve race conditions and update tests for kilo compatibility
Remove eager publish call in indexing initialization that caused
premature event emission. Add foreign key constraint tolerance in
next-message projector to handle writes racing against deleted
sessions. Fix test environment isolation for gateway headers and
permission tests, update auth test assertions to use "kilo" username,
and remove stale indexing route from httpapi-bridge expectations.
2026-05-20 12:05:59 +02:00
Imanol Maiztegui 8e053f34b5 refactor(opencode): extract indexing event schema and align OpenAPI contracts
Move the IndexingStatus Effect schema out of the KiloIndexing namespace into
a dedicated `indexing-event.ts` module so it can be shared between the bus
event system and the HttpApi layer without circular imports.

Additionally fix several OpenAPI spec inconsistencies:
- Inline PermissionReplyBody into the endpoint payload schema
- Make `organizationId` nullable in the organization set endpoint
- Replace opaque string response for `/kilo/fim` with a structured
  streaming completion schema
- Register `indexing.status` as a typed SSE event in the global event union
- Add `matchLegacyKiloOpenApi` post-processor for backward-compatible
  nullable fields and FIM response shape
- Relocate Kilo-specific bridge tests to `test/kilocode/server/` and trim
  duplicated assertions from the core bridge test file
2026-05-19 10:50:52 +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 d7fcb894ed refactor(kilo-gateway): clean up proxy auth naming, error handling, and OpenAPI schema alignment
Rename `proxy` helper to `proxyAuth` for clarity, switch modes endpoint
to gracefully handle missing auth instead of returning BadRequest, remove
redundant Content-Type header from audio transcriptions response, and
fix OpenAPI parameter types:

- Change `worktrees` query param from string enum to boolean
- Add `^que.*` pattern to network endpoint requestID path params
- Register experimental session worktrees in query parameter schemas
- Re-enable and update Effect HttpApi route parity tests
2026-05-18 15:51:10 +02:00
Imanol Maiztegui f560e5bd7a refactor(kilo-gateway): extract cloud sessions logic and wire up cloud sync endpoints
Move inline cloud-sessions fetch logic from Hono route handler into a
reusable getCloudSessions function in handlers.ts, and introduce new
Effect HttpApi endpoints for fetching and importing individual cloud
sessions.

- Extract getCloudSessions handler from routes.ts inline implementation
- Export fetchCloudSession, fetchCloudSessionForImport, importSessionToDb
  from kilo-gateway package
- Add cloudSession (GET /kilo/cloud/session/:id) endpoint for previewing
  remote session data
- Add cloudSessionImport (POST /kilo/cloud/session/import) endpoint to
  download and persist cloud sessions locally
- Define CloudSession, CloudSessionData, CloudMessage schemas in the
  kilo-gateway API group
- Change claw status error response from 500 InternalServerError to
  503 ServiceUnavailable
- Register new cloud routes in instance router
- Add test coverage for route disambiguation between import and :id paths
- Regenerate SDK types and OpenAPI spec
2026-05-18 14:38:21 +02:00
Imanol Maiztegui 0b41d2dc4b feat(kilocode): migrate kilo HTTP routes to Effect HttpApi layer
Introduce a structured Effect HttpApi surface for all Kilo-specific
endpoints, replacing inline Hono handler logic with declarative group
definitions, typed schemas, and composable handler layers.

Key changes:
- Add HttpApi group and handler modules for commit-message, enhance-prompt,
  indexing, kilocode, network, remote, session-import, suggestion, and
  telemetry
- Extract allow-everything permission logic into a reusable Effect function
- Register all Kilo HttpApi groups in InstanceHttpApi and wire route
  forwarding in the Hono instance router
- Export Suggestion.RequestSchema and annotate schemas with identifiers
- Use NonNegativeInt for indexing status fields and Schema.Finite for
  network wait timestamps
- Add httpapi-bridge test asserting parity between Hono and Effect specs
  for all 22 Kilo overlay routes
- Regenerate SDK types and openapi.json to reflect the new endpoints
2026-05-18 12:36:01 +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
Mark IJbema a2bb05726f Merge remote-tracking branch 'origin/main' into markijbema/kilo-opencode-v1.14.33 2026-05-07 10:44:08 +02:00
Mark IJbema 8cdfaea017 fix(cli): skip HttpApi JSON parity tests
Two structural divergences make the upstream-added parity test unrunnable on Kilo:

1. Effect's HttpApi runtime emits 'field: null' for Schema.optional() values when the source data has the property as undefined. Hono uses JSON.stringify which omits undefined keys. Kilo-specific Model fields (ai_sdk_provider, prompt, recommendedIndex, isFree) and Command fields (agent, model, subtask) all hit this.
2. Reading /config twice in sequence (legacy then httpapi) returns different defaults as Kilo's ConfigService cache mutates between calls.

The test is upstream-added; opencode's schema doesn't carry these extra fields, so it doesn't trip the divergence. Skip until either Kilo migrates the affected schemas to NullOr (changing the public surface) or the parity test learns to ignore Kilo-specific fields.
2026-05-06 22:34:04 +02:00