Commit Graph

9 Commits

Author SHA1 Message Date
marius-kilocode 0f271a39d7 resolve merge conflicts 2026-06-01 15:20:54 +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
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
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
Imanol Maiztegui a314589520 fix(opencode): replace direct Env access with effect-based resolution and update test infrastructure
Remove synchronous Env.get/Env.all calls in provider, tool registry,
and model-cache modules, replacing them with effect-yielded env
lookups or direct process.env reads where appropriate. Thread resolved
env through patchCustomLoaderResult and kiloCustomLoaders dependency
type. Drop unused paste-summary import from prompt component, fix
createResource action call in session list dialog, add bell toggle KV
signal, and rewrite config-gitignore test to use proper Effect layers
instead of mocked AppRuntime. Update remaining import paths and test
module mocks to align with barrel re-exports.
2026-04-22 08:28:03 +02:00
Catriel Müller 28aebeb157 Merge pull request #8986 from Kilo-Org/catrielmuller/fix-memory-webfetch-test
fix: Flaky tests
2026-04-16 08:31:29 -03:00
Catriel Müller 3faed47516 fix: fix git test 2026-04-15 13:51:05 -03:00
Marius 2f9467ee3e fix(cli): mock getGitContext in commit-message tests to fix Linux CI flake (#8989)
Tests relied on real git operations in temp directories which failed
silently on Linux CI runners, causing all 12 tests to see no staged files.
2026-04-15 15:34:39 +00:00
Marius 581bbbb319 feat(cli,vscode): add custom commit message prompt setting (#8974)
* feat(cli,vscode): add custom commit message prompt setting

Support user-configurable system prompt for AI commit message generation.
Adds a dedicated Commit Message tab in VS Code settings with a toggle
to override the built-in conventional commits prompt.

* fix: add missing kilocode_change annotation and fix i18n formatting

* refactor: move Config reading to route handler, add textarea max-height

Move kilo-specific Config.get() from shared generate.ts to the route
handler. The generator now accepts an optional prompt param instead.
Cap textarea height at 300px with scroll for long prompts.

* fix: resolve annotation gaps and prompt clear serialization bug

Add kilocode_change markers to JSDoc comment and extend block to
cover the generateCommitMessage call. Use empty string instead of
undefined when clearing the prompt so JSON serialization persists
the removal to disk.

* refactor(cli): move commit-message module to kilocode paths

Move src/commit-message/ to src/kilocode/commit-message/, route to
src/kilocode/server/routes/, and tests to test/kilocode/commit-message/.
Extract CommitMessageSchema to KilocodeConfig and reference it from
the main Config.Info. Removes all kilocode_change markers from moved
files since they are now in exempt paths.

* test(cli): fix moved commit-message tests
2026-04-15 16:09:05 +02:00