Commit Graph

1327 Commits

Author SHA1 Message Date
Imanol Maiztegui 24d1f693ef refactor(opencode): migrate zod schemas to effect Schema across kilo modules
Replace zod schema definitions with effect Schema equivalents in
BusEvent definitions, tool parameters, session network, suggestions,
and related modules. This aligns Kilo-specific code with the upstream
v1.14.23 migration from zod to effect Schema.

- Convert BusEvent property schemas from zod objects to Schema.Struct
- Migrate tool parameter definitions (recall, warpgrep, suggest) to
  Schema.Struct with annotated descriptions
- Replace zod-based SessionNetwork.Wait with effect Schema and add
  zod interop via withStatics helper
- Extract shared EditorContext schema in message-v2 and reuse in
  prompt input
- Replace `fn()` wrappers in session.ts with explicit
  Schema.decodeUnknownSync calls for type safety
- Use branded SessionID/QuestionID types in place of raw z.string()
- Update pending map in SessionNetwork from Record to Map<QuestionID>
- Update tests to use SessionID.make() for branded identifiers
2026-04-27 18:34:48 +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
Imanol Maiztegui 93044b183b test(session): add explicit variant field to subtask cost propagation test
Include `variant: undefined` in metadata objects to match the expected
shape returned by the provider, ensuring the assertion compares all
fields accurately.
2026-04-27 13:17:40 +02:00
Imanol Maiztegui 76b53c6403 fix(opencode): resolve merge conflict in session prompt test
Remove conflict markers left from rebasing the subtask cost
propagation test, keeping the version without the extra `variant`
field.
2026-04-27 13:16:32 +02:00
Imanol Maiztegui 4267cd319b test(session): add test for handleSubtask propagating child session cost to wrapper
Verify that when a subtask completes, the child session's assistant
cost is correctly propagated to the parent wrapper message. This
covers the cost aggregation path in handleSubtask for subagent
interactions.
2026-04-27 13:15:27 +02:00
hdcode.dev 438316b09a fix(cli): stop hardcoding opencode in kilo pr (#6824)
* fix(cli): stop hardcoding opencode in kilo pr

* fix(cli): stop hardcoding opencode in kilo pr

* fix pr command cli resolution for subcommand args
2026-04-27 13:14:47 +02:00
Alex Alecu 9e419b3e86 fix(cli): count subagent stats 2026-04-27 13:14:10 +02:00
Alex Alecu 2a94a0cc11 fix(cli): ignore deleted cost sync 2026-04-27 13:14:10 +02:00
Alex Alecu af0227b1ab fix(cli): exclude subagent sessions from stats aggregate
The task tool propagates each child session's total cost into the parent's tool-wrapper assistant message. Counting both root and child sessions in `kilo stats` would double-count that contribution. Filter `getAllSessions()` to root sessions (parent_id IS NULL), matching how the TUI session list and web sidebar already treat child sessions.
2026-04-27 13:14:10 +02:00
Alex Alecu f57479c657 fix(cli): serialize concurrent subagent cost propagation 2026-04-27 13:14:10 +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
Imanol Maiztegui a63a27a366 Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.14.22 2026-04-27 11:23:37 +02:00
Marius a5bca011a1 Allow ChatGPT login over OpenAI provider config (#9549)
* fix: allow ChatGPT login over OpenAI provider config

Let users with inherited or globally configured OpenAI API keys sign in with ChatGPT for Codex without first removing their existing provider setup.

* fix: satisfy provider login ci checks

Annotate Kilo-specific shared CLI changes and apply webview formatting so the existing ChatGPT login flow passes CI.
2026-04-27 11:17:04 +02:00
Marius dbf113524e fix(cli): guard external directory boundaries (#9484)
* fix(cli): guard external directory boundaries

* test(cli): move boundary regressions to kilocode tests

* fix(cli): scope root guard to permission prompts

* test(cli): isolate boundary regression fixtures

* test(cli): simplify boundary regression coverage
2026-04-27 11:15:57 +02:00
Marian Alexandru Alecu a2b72044e0 Merge branch 'main' into fix/queued-messages-test 2026-04-27 11:48:19 +03:00
Imanol Maiztegui 94f47d452e Merge branch 'main' into fix/openrouter-deepseek-reasoning 2026-04-27 09:54:31 +02:00
kiloconnect[bot] f631338576 chore(cli): add kilocode_change markers to ported shell cwd fix 2026-04-27 07:38:01 +00:00
kiloconnect[bot] e8c13e0ee8 fix(cli): preserve shell cwd after login startup 2026-04-27 07:31:57 +00:00
Alex Alecu 778c5a84e0 test(cli): guard queued prompt request tail (#9492)
Strengthen the Kilo queue integration test to capture each LLM
request body and assert the second request ends with the queued
user message, not a prior-turn assistant tail. Update the skipped
upstream prompt-effect active-run test comment to reference #9492
and point at the Kilo-specific authoritative coverage.
2026-04-27 10:22:03 +03:00
Josh Lambert 55ddf87040 Revert "fix(cli): also skip interleaved reasoning transform for @kilocode/kilo-gateway"
This reverts commit 1dd436d61a.
2026-04-26 19:55:56 -04:00
Josh Lambert 1dd436d61a fix(cli): also skip interleaved reasoning transform for @kilocode/kilo-gateway
The gateway wraps @openrouter/ai-sdk-provider internally, so the same
openrouter SDK-side reasoning handling applies. Without this, users
routing through api.kilo.ai still see DeepSeek 400 'reasoning_content
must be passed back' errors.
2026-04-26 11:29:26 -04:00
Josh Lambert a1557d1a1f chore: annotate cherry-picked upstream changes with kilocode_change markers 2026-04-26 11:09:07 -04:00
Aiden Cline c884cea5ba fix: ensure openrouter behaves correctly 2026-04-26 10:55:41 -04:00
Imanol Maiztegui 44f463fdba test: skip ripgrep-dependent tests on windows 2026-04-25 18:05:56 +02:00
Imanol Maiztegui b21778dec1 refactor(session): pass cwd as positional arg to login shells instead of capturing it
Replace the `pwd -P` approach with an explicit positional argument (`$1`)
for zsh and bash login shell invocations. Login shells source profile
scripts (`/etc/profile`, `~/.profile`, `~/.bashrc`) before the `-c`
script executes, and those scripts may change the working directory
(e.g. nvm, direnv), making both `$PWD` and `pwd -P` unreliable at
script evaluation time. By passing `ctx.directory` as `$1` and falling
back to `$PWD` when unset, the shell script always receives the correct
session directory regardless of profile side effects.

Simplify the corresponding integration test by removing verbose CI
debug probes and replacing them with a straightforward `pwd` assertion.
2026-04-25 11:09:17 +02:00
Imanol Maiztegui 7672adb18d fix(opencode): use pwd -P in shell spawns to resolve stale PWD on CI
Replace `$PWD` with `$(pwd -P)` when capturing the working directory
in zsh and bash login shell invocations. When the child shell inherits
a stale PWD environment variable — common in CI where the spawner's
cwd differs from the session directory — `$PWD` can point to the wrong
location, causing `cd "$__oc_cwd"` to silently escape the intended
directory. `pwd -P` queries the kernel via getcwd(), ensuring the
correct physical path is always used.

The corresponding test is updated with richer cwd diagnostics to
validate the fix and surface root-cause information on failure.
2026-04-25 10:09:58 +02:00
Imanol Maiztegui 2fb8052640 Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.14.22 2026-04-25 08:23:31 +02:00
Imanol Maiztegui 9fb07cac6d test(opencode): skip flaky prompt tests and update agent reference
Skip "glob tool keeps instance context during prompt runs" and
"prompt submitted during an active run" tests tracked in #9958.
Replace "build" agent assertion with "code" to align with Kilo
agent naming conventions.
2026-04-25 08:17:29 +02:00
Imanol Maiztegui 2a6c4294eb fix(opencode): remove mistral from reasoning model check and rebrand cache paths
Remove mistral from the provider reasoning variant detection list
and update bare repo test assertions to use "kilo" cache directory
naming instead of "opencode".
2026-04-24 21:59:56 +02:00
Josh Holmer a356f3a923 fix(cli): respect configured model for subagents (#7549)
* fix(cli): respect configured model for subagents

* fix(cli): also respect configured variant for subagents
2026-04-24 21:44:08 +02:00
Imanol Maiztegui 3cec1ffa87 refactor(snapshot): introduce SummaryFileDiff schema and tighten Kilo type annotations
Add a lightweight SummaryFileDiff derived from FileDiff via
Struct.omit(["patch"]) to keep session summary DB payloads small.
Replace inline anonymous object types in session.sql.ts, revert.ts,
and session.ts with the new schema. Cast SessionPrompt input in
remote-sender to satisfy narrowed PromptInput type, guard against
null in permission normalizeInput, and switch remaining bare .parse
calls to .zod.parse for Effect Schema compatibility.

Include unit tests verifying SummaryFileDiff field exclusion and
round-trip parsing behavior.
2026-04-24 19:15:13 +02:00
Imanol Maiztegui eea72116be fix(kilocode): update schema references to use .zod accessor after effect migration
Replace direct Zod schema calls (Config.Info.parse, Config.Info.safeParse,
Snapshot.FileDiff, WorktreeDiff.Item) with their .zod counterparts to
align with the Effect Schema migration that wraps schemas via withStatics.

Migrate WorktreeDiff.Item from Zod's z.object/extend to Effect's
Schema.Struct with annotate and zod bridge. Add missing return statement
in TsClient notify.open stub and widen waitForDiagnostics input type to
match updated upstream interface.
2026-04-24 17:26:59 +02:00
Imanol Maiztegui 5e519256d2 resolve merge conflicts 2026-04-24 16:58:05 +02:00
Imanol Maiztegui 5bd50c6fe2 refactor: kilo compat for v1.14.22 2026-04-24 14:18:25 +02:00
Imanol Maiztegui 8eb0bb3e84 fix(read): skip binary detection for UTF-16 BOM encoded files
Add a check for UTF-16 byte order marks before the NUL/control-char
heuristic so that legitimate UTF-16 encoded files are not incorrectly
classified as binary. Also update Opus 4.7 transform test to expect
the `display: "summarized"` property in xhigh reasoning config.
2026-04-24 13:49:10 +02:00
Imanol Maiztegui 258fe2c8a3 Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.14.17 2026-04-24 13:31:41 +02:00
Imanol Maiztegui a2ae026f50 test(tui): trim verbose backstory from slot reactivity test header
Remove implementation history paragraph from the test file's doc
comment, keeping only the concise description of what the test
validates.
2026-04-24 11:24:02 +02:00
Imanol Maiztegui 07024a0341 fix(tui): preserve SolidJS prop reactivity in Slot wrapper
Replace object spread (`{...props}`) with `mergeProps` when forwarding
props through the plugin Slot wrapper. Spreading props in SolidJS
evaluates each prop once at mount time, freezing reactive values like
`ref`, `visible`, `disabled`, and `on_submit`. This caused handlers to
bind against stale closures after overlay transitions, breaking Enter
submission on the session_prompt slot.

Add regression tests verifying the wrapper uses `mergeProps` (not
spread) and that reactive prop tracking is preserved at runtime.
2026-04-24 11:22:30 +02:00
Imanol Maiztegui 93a1a00361 refactor: adapt kilo compat layer for v1.14.17 API changes
- Switch ConfigCommand validation from Zod to Effect Schema using
  StandardSchemaV1 interface
- Fix toConfig permission merging to avoid mutating shared object
- Wrap saveAlwaysRules route handler with jsonRequest/Effect generator
- Update Typescript.spawn call sites to pass InstanceContext parameter
- Fix Npm import path in config-gitignore test
2026-04-24 10:30:50 +02:00
Imanol Maiztegui 7d1c046f10 resolve merge conflicts 2026-04-24 10:06:31 +02:00
rahul f8c6ddd4cb feat(truncate): allow configuring tool output truncation limits (#23770)
Co-authored-by: rgs_ramp <rgs@ramp.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
2026-04-23 17:43:33 -04:00
Kit Langton e50a688ca3 feat(httpapi): bridge workspace read endpoints (#24062) 2026-04-23 17:32:02 -04:00
Aiden Cline 334ab4707c fix: account for additional openai retry case (#24063) 2026-04-23 17:31:43 -04:00
Kit Langton 3910a6e527 refactor(tool): migrate tool framework + all 18 built-in tools to Effect Schema (#23244) 2026-04-23 16:09:34 -04:00
Kit Langton cd93533b1f refactor(bus): migrate BusEvent to Effect Schema (#24040) 2026-04-23 15:37:44 -04:00
Kit Langton c50d65b4d6 refactor(sync): make session events schema-first (#24019) 2026-04-23 12:43:08 -04:00
opencode-agent[bot] 353532b1c1 chore: generate 2026-04-23 16:00:01 +00:00
Shoubhit Dash 9df7c78ebe fix(npm): respect npmrc for version lookups (#24016) 2026-04-23 21:28:54 +05:30
Kit Langton 0517ab4695 refactor(session): migrate session domain to Effect Schema (#24005) 2026-04-23 11:30:02 -04:00