Commit Graph

80 Commits

Author SHA1 Message Date
Imanol Maiztegui abdef9a7ee feat(opencode): add tool metadata buffering and migrate virtua to v0.42.3
Introduce a `metadata` method on SessionProcessor.Handle that buffers
metadata emitted before tool-call registration, then applies it on the
running transition. This decouples metadata emission timing from
tool-call lifecycle.

Downgrade virtua from 0.49.1 to 0.42.3 and migrate the virtualizer API:
- Replace `findItemIndex(scrollOffset)` with `findStartIndex()`
- Replace `bufferSize` prop with `overscan` (count-based)

Additional changes:
- Change Permission.reply return type from Promise<boolean> to Promise<void>
- Make Ruleset type readonly and remove unnecessary array spreads
- Update nvidia provider headers to reference Kilo branding
- Reorder SDK event type definitions for installation events
- Reduce promise facade allowlist in check script
2026-06-17 16:41:43 +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
markijbema 670f2fad30 test(cli): remove session cancellation timing races
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
2026-06-16 11:23:08 +00:00
Catriel Müller 79e4af75fa test(cli): stabilize Windows session tests 2026-06-15 16:37:11 -03:00
Imanol Maiztegui 5b9e33cfef refactor: kilo compat for v1.15.9 2026-06-15 14:48:05 +02:00
marius-kilocode 941accc2fc Merge origin/main into OpenCode v1.15.4 2026-06-12 16:10:38 +02: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 27d2c148d0 fix: complete OpenCode v1.14.51 integration 2026-06-09 11:53:08 +02:00
marius-kilocode 6ecaaab48a refactor: kilo compat for v1.14.51 2026-06-09 08:29:02 +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
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 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 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
kiloconnect[bot] 2f3068e18d test(cli): move new providerCost tests into test/kilocode/
Move the new Anthropic Messages, OpenAI Responses and Vercel AI Gateway
cost-extraction tests out of the shared upstream `test/session/compaction.test.ts`
file into `test/kilocode/provider-cost.test.ts` to keep Kilo-specific test
coverage in a Kilo-owned location and minimize merge conflicts with upstream.
2026-05-07 14:56:24 +00:00
kiloconnect[bot] c8073d9014 fix(cli): also extract Kilo cost from OpenAI Responses API responses
Refactor providerCost to read `usage.raw.cost_details.upstream_inference_cost`,
which both `@ai-sdk/anthropic` (`convertAnthropicUsage`) and `@ai-sdk/openai`
(`convertOpenAIResponsesUsage`) populate with the verbatim OpenRouter usage
object. This unifies the Anthropic Messages and OpenAI Responses cost paths
through a single branch and removes the redundant `metadata.anthropic.usage`
branch (the SDK exposes the same data under both keys for Anthropic, and only
under `raw` for Responses).
2026-05-07 14:51:18 +00:00
kiloconnect[bot] 861eb522ad fix(cli): never use gateway-fee cost for Anthropic Messages paths
For the Anthropic Messages API (via OpenRouter or Vercel AI Gateway), the
top-level `cost` field is the gateway fee that Kilo paid (typically 0 for
BYOK), not the user's true spend. Only use `upstream_inference_cost` /
`marketCost`; fall back to the token-based calculation when those are
absent.
2026-05-07 14:27:14 +00:00
kiloconnect[bot] 3423870eea fix(cli): extract Kilo provider cost from Anthropic Messages API responses
Cost reporting already worked when Kilo used OpenRouter chat completions
internally. Extend providerCost to also read cost from the Anthropic
Messages API stream metadata, covering both OpenRouter (Anthropic-style
`usage.cost` / `cost_details.upstream_inference_cost`) and Vercel AI
Gateway (`gateway.cost` / `gateway.marketCost`).
2026-05-07 13:07:52 +00:00
Mark IJbema 3f7037549e resolve merge conflicts 2026-04-30 16:25:46 +02:00
Dax f25f1485d5 refactor: remove module barrels (#24554) 2026-04-27 14:33:33 -04:00
Imanol Maiztegui fd8818e48c resolve merge conflicts 2026-04-27 15:57:16 +02: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
Dax Raad 3eee2f6afa core: move cross-spawn-spawner from opencode to core package
Moved the cross-spawn-spawner module from packages/opencode to packages/core
to enable code sharing across the monorepo. This consolidates the process
spawning infrastructure into the core package so other packages can use
cross-platform child process spawning without duplicating the implementation.

Updated all import statements across the codebase to reference the new
location (@opencode-ai/core/effect/cross-spawn-spawner). Removed the
local copy from the opencode package along with its tests.
2026-04-25 14:23:17 -04:00
Imanol Maiztegui 5e519256d2 resolve merge conflicts 2026-04-24 16:58:05 +02:00
Kit Langton 0517ab4695 refactor(session): migrate session domain to Effect Schema (#24005) 2026-04-23 11:30:02 -04:00
opencode-agent[bot] 504fd1b373 chore: generate 2026-04-23 00:25:39 -04:00
Shoubhit Dash 574b2c2170 fix(session): improve session compaction (#23870) 2026-04-23 00:25:38 -04:00
Kit Langton ecc06a3d8f refactor(core): make Config.Info canonical Effect Schema (#23716) 2026-04-21 14:06:47 -04:00
Imanol Maiztegui d5357f3961 resolve merge conflicts 2026-04-21 18:03:34 +02:00
opencode-agent[bot] f3d5a71620 chore: generate 2026-04-20 06:07:28 +00:00
Aiden Cline c6c56ac2cf tweak: rename tail_tokens -> preserve_recent_tokens (#23491) 2026-04-20 01:06:29 -05:00
Dax Raad b9640fc7e4 core: fix session compaction test to properly enable prune config option 2026-04-19 19:53:43 -04:00
Imanol Maiztegui 2ee8394cf1 feat: add workspace API endpoints, sanitize export flag, and update SDK types
Add experimental workspace adaptor list and status endpoints to the
OpenAPI spec. Add --sanitize flag to CLI export command for redacting
sensitive data. Update SDK types to reorder session status types before
suggestion types. Remove deprecated /global/sync-event endpoint.

Includes formatting fixes across i18n files, opencode source, and
tests, plus a warpgrep import path correction.
2026-04-17 22:51:24 +02:00
Johnny Amancio feea749c51 fix: Resolve test failures for v1.4.4 merge
- Break circular import: Worktree → bootstrap → remote-sender → app-runtime (Not to Kilo not being completely on effect)
- Bump tight test timeouts for Effect-native processing overhead
2026-04-17 11:15:01 +02:00
Shoubhit Dash 42771c1db3 fix(compaction): budget retained tail with media 2026-04-16 17:30:29 +05:30
Shoubhit Dash 2e18a603f0 merge dev 2026-04-16 17:30:14 +05:30
Kit Langton 80f1f1b5b8 feat: enable type-aware no-floating-promises rule, fix all 177 violations (#22741) 2026-04-15 23:27:32 -04:00
Kit Langton 343a564183 feat: unwrap 11 util namespaces to flat exports + barrel (#22739) 2026-04-15 23:15:58 -04:00
Kit Langton 34213d4446 fix: delete 9 dead functions with zero callers (#22697) 2026-04-16 02:01:02 +00:00
Kit Langton 1d81335ab5 feat: unwrap Provider namespace + improved automation script (#22690) 2026-04-15 21:44:46 -04:00
Kit Langton f7d4665e40 fix: resolve oxlint warnings — suppress false positives, remove unused imports (#22687) 2026-04-15 21:33:54 -04:00
Kit Langton bbdbc107ae feat: unwrap Config namespace to flat exports + barrel (#22689) 2026-04-15 21:26:24 -04:00
Johnny Amancio 501ebbf0eb fix: Fix typecheck issues 2026-04-16 01:39:31 +02:00
Johnny Amancio 915f12c7e2 resolve merge conflicts 2026-04-15 22:51:15 +02:00
Aiden Cline e83b22159d tweak: ensure auto continuing compaction is tracked as agent initiated for github copilot (#22567)
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
2026-04-15 15:50:33 -05:00
Catriel Müller 1c67e0fe71 resolve merge conflicts 2026-04-14 17:05:48 -03:00