Commit Graph

760 Commits

Author SHA1 Message Date
Johnny Amancio 794189b5d9 feat(cli): add project memory integration 2026-06-18 20:56:52 +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 e7ac3bf151 Merge remote-tracking branch 'origin/main' into marius-kilocode/kilo-opencode-v1.14.48
# Conflicts:
#	packages/opencode/test/kilocode/session-export/e2e.test.ts
2026-06-08 19:22:31 +02:00
Igor Šćekić 6ee090b5a4 Restore cloud session diffs on import (#10948)
* feat(cli): restore cloud session diffs on import

* fix(cli): hide git diff restore subprocesses

* fix(cli): harden session diff path guard

* test(cli): keep diff restore test synchronous

* test(cli): normalize diff restore line endings

* fix(cli): preserve imported diffs across session forks

* chore: remove session ingest findings doc

* fix(cli): avoid duplicate cumulative session diffs

* test(cli): isolate session export test failures

* fix(cli): preserve cumulative cloud fork diffs

* fix(cli): avoid cumulative diff prefix duplication
2026-06-08 15:44:03 +00: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 344df31dcf Merge remote-tracking branch 'origin/main' into marius-kilocode/kilo-opencode-v1.14.46
# Conflicts:
#	packages/opencode/src/config/provider.ts
2026-06-02 18:30:26 +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 ece920c1cc Merge remote-tracking branch 'origin/main' into trial/kilo-opencode-v1.14.42
# Conflicts:
#	bun.lock
#	packages/opencode/src/cli/cmd/run.ts
#	packages/opencode/src/cli/cmd/tui/context/tui-config.tsx
#	packages/opencode/src/cli/cmd/tui/thread.ts
#	packages/opencode/src/cli/cmd/tui/ui/dialog-alert.tsx
#	packages/opencode/src/kilocode/server/httpapi/instance.ts
#	packages/opencode/src/kilocode/server/instance.ts
#	packages/opencode/src/server/routes/global.ts
#	packages/opencode/src/server/routes/instance/index.ts
#	packages/opencode/src/server/routes/ui.ts
#	packages/opencode/test/kilocode/global-config-refresh.test.ts
#	packages/opencode/test/kilocode/server/httpapi-public.test.ts
2026-06-02 10:42:14 +02:00
Catriel Müller 79ac67b3c9 refactor: merge main 2026-06-01 13:54:53 -03:00
Catriel Müller 24943b1fda Merge branch 'main' into sharp-balance 2026-06-01 12:48:04 -03:00
marius-kilocode 78bfc700ea fix: harden upstream v1.14.42 integration 2026-06-01 16:11:59 +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
Catriel Müller cf85e0d51f feat: embedded kilo console 2026-05-29 21:01:45 -03:00
marius-kilocode e4095af8d3 refactor(cli): remove Question compatibility facade 2026-05-29 12:15:48 +02:00
Catriel Müller 3c96a7c8d3 refactor: fix merge main 2026-05-28 14:20:13 -03:00
Catriel Müller 9efb241f43 refactor: merge main 2026-05-28 11:18:39 -03: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
marius-kilocode dcfadac83e fix(cli): prevent stale global config reloads 2026-05-27 15:13:51 +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
Catriel Müller 2062335803 fix: fix test 2026-05-22 10:42:20 -03:00
Catriel Müller a1ff9105a3 Merge branch 'main' into dynamic-department 2026-05-22 10:41:45 -03:00
Imanol Maiztegui 4a28a5f88f Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.14.41 2026-05-22 13:15:04 +02:00
Imanol Maiztegui b6523c0d91 resolve merge conflicts 2026-05-22 09:01:40 +02:00
Catriel Müller fca2afcf1e refactor: kilo command branding 2026-05-21 14:08:24 -03:00
Imanol Maiztegui f7816a9eeb refactor: kilo compat for v1.14.41 2026-05-21 14:48:36 +02:00
Catriel Müller cd009c3d8f feat: background process 2026-05-21 09:13:55 -03:00
Catriel Müller 3648e2e132 wip: kilo console 2026-05-20 13:43:02 -03:00
Imanol Maiztegui 22486c90eb refactor(repo): rebrand to kilo and improve issue triage configuration
Replace legacy "opencode" references with "kilo" in CLI output,
API metadata, SDK error messages, and documentation. Add automatic
labels to GitHub issue templates, expand triage agent with jetbrains
and extension teams, and update the github-triage tool to target the
Kilo-Org/kilocode repository.
2026-05-20 10:05:31 +02:00
Imanol Maiztegui ecc2f7af19 feat(kilocode): introduce EffectBridge for async-to-effect interop and lazify runtime constructors
Replace raw `Effect.promise` calls across HTTP API handlers with
`EffectBridge.fromPromise` / `EffectBridge.make` to ensure proper error
propagation and context forwarding when bridging imperative async code
into the Effect runtime.

Wrap top-level `makeRuntime` calls in `plan-followup.ts` with `lazy()`
to defer service instantiation until first access, avoiding eager
initialization side-effects during module loading.

Also reorder SDK event union members and type definitions to reflect
updated OpenAPI schema generation output.
2026-05-19 14:33:15 +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 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 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 a1a1936416 feat(kilocode): add worktree diff, FIM proxy, audio transcription, and session viewed endpoints
Introduce several new Effect HttpApi endpoints across the kilo-gateway
and experimental API groups to support agent manager workflows and
enhanced gateway proxying.

- Add worktree diff endpoints (diff, diff/summary, diff/file) for
  comparing worktree changes against a base branch
- Add FIM completion proxy endpoint with streaming SSE response and
  timeout handling
- Add audio transcriptions proxy endpoint forwarding to Kilo Gateway
- Add organization modes endpoint to fetch custom modes config
- Add session/viewed endpoint to track which sessions the user has open
- Extend session list query with projectID and worktrees parameters
- Register all new routes in Hono instance router
- Regenerate SDK types and OpenAPI spec
2026-05-18 15:41:42 +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 580a94aaaf feat(kilo-gateway): add Effect HttpApi endpoints for kilo gateway operations
Extract shared handler logic from Hono routes into reusable functions in
kilo-gateway/server/handlers.ts and wire up new Effect HttpApi endpoints
for profile, notifications, organization switching, claw status, and
claw chat credentials.

- Add handlers.ts with pure business logic (getProfile, getNotifications,
  setOrganization, getClawStatus, getClawChatCredentials)
- Define KiloGatewayApi group with typed schemas for all endpoints
- Implement Effect-based handler layer in httpapi/handlers/kilo-gateway.ts
- Register kilo gateway routes in instance router and HttpApi composition
- Add config/warnings endpoint to config group and handler
- Regenerate SDK types and client methods for new endpoints
- Update OpenAPI spec with /kilo/* and /config/warnings paths
- Export new constants (KILO_CHAT_URL, KILO_EVENT_SERVICE_URL) and
  handler utilities from kilo-gateway package index
2026-05-18 14:03:20 +02:00
Imanol Maiztegui 09923fbe52 style: apply formatting and lint fixes across packages
Reformat code with consistent line breaks, trailing commas, semicolons,
and line-length compliance. No logic changes — purely whitespace,
indentation, and punctuation adjustments driven by the project formatter.

- Break long function signatures and conditionals across multiple lines
- Remove trailing blank lines and stray leading newlines
- Replace string-expression JSX whitespace with literal spaces
- Convert quoted object keys to unquoted where valid
- Remove erroneous shell command prefix from openapi.json
- Deduplicate SessionNetworkWait1 schema and simplify Finite unions to
  plain number type in OpenAPI spec
2026-05-18 12:40:16 +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