Commit Graph

252 Commits

Author SHA1 Message Date
Alex Alecu 67993d094e Merge remote-tracking branch 'origin/main' into fix/costs-of-subagents 2026-04-27 13:03:15 +03: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
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 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
Alex Alecu bc90a50597 fix(cli): count subagent stats 2026-04-24 19:19:41 +03:00
Alex Alecu 1230a3af8b fix(cli): ignore deleted cost sync 2026-04-24 19:19:35 +03:00
Alex Alecu 195ef4e54f 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-24 19:06:08 +03: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
Alex Alecu ae0c437791 fix(cli): serialize concurrent subagent cost propagation 2026-04-24 07:26:09 +03:00
kiloconnect[bot] bde1a4ae88 test(cli): expand encoding preservation coverage
Add unit tests for the Encoding namespace and extend the tool integration
suite with ApplyPatch delete and EditTool replaceAll paths for non-UTF-8
files.
2026-04-23 14:49:05 +00:00
Christiaan Arnoldus 529c3a57f3 Merge pull request #8587 from Kilo-Org/feat/encoding-preservation
feat(cli): preserve original text encoding when editing files
2026-04-23 16:20:23 +02:00
Alex Alecu a22d65e0d7 Merge branch 'main' into fix/queue-messages
Resolve conflicts in question/index.ts, session/prompt.ts, and KiloProvider.ts to pull in upstream's flattened namespace refactor while preserving the queued-messages feature: Question.dismissAll, KiloQuestion.guardFollowup on ask, and the mid-turn 'break out when a follow-up is queued' check in runLoop. VS Code abortSession keeps its queue-preserving signature (no queuedMessageIDs delete); new autocomplete settings helpers from main are wired in unchanged.
2026-04-23 16:45:54 +03:00
kiloconnect[bot] fd04901452 Merge remote-tracking branch 'origin/main' into feat/encoding-preservation
# Conflicts:
#	packages/opencode/src/patch/patch.ts
#	packages/opencode/src/tool/edit.ts
#	packages/opencode/src/tool/write.ts
2026-04-23 13:38:19 +00:00
Imanol Maiztegui f99974e9c5 Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.4.9 2026-04-23 14:15:54 +02:00
Imanol Maiztegui c7c1e17352 feat(opencode): include filediff metadata in edit tool permission ask
Add `filediff` field to the edit tool's permission-ask metadata so the
VS Code extension's PermissionDock can render inline diff previews.
Sort and deduplicate dependency entries in package.json. Include a
comprehensive test suite verifying filediff presence across new file
creation, existing file edits, and multi-line replacements.
2026-04-23 14:13:46 +02:00
Imanol Maiztegui 77566d3027 refactor: update imports, fix bugs, and align with v1.4.9 upstream changes
- Fix import paths in kilocode server instance to use routes directory
- Convert relative imports to path aliases in experimental and session routes
- Fix variable name bug in fromModelsDevModel (m -> base) for patchKiloModel
- Add null guard for VITE_KILO_CHANNEL in titlebar before calling includes
- Simplify model schema by replacing safeEnum with direct Schema.Literals
- Remove unused fullSyncedSessions set from sync context
- Add blocking option to question ask interface
- Remove FileTime dependency from read-directory and session-compaction tests
- Remove unnecessary @ts-expect-error comments for Flag overrides in tests
- Fix Account import path in config-gitignore test
- Regenerate SDK with new session list params (projectID, worktrees),
  deduplicated Console class, and updated timeout default to 300000ms
2026-04-23 13:51:49 +02:00
kiloconnect[bot] eb52bda015 fix(cli): prevent double BOM when content starts with U+FEFF
Strip a leading U+FEFF from text before prepending a UTF-8/UTF-16 BOM so
round-tripping content that already carries a BOM character emits exactly
one BOM. Also clarifies the changeset that new files default to UTF-8.
2026-04-23 10:04:01 +00:00
Imanol Maiztegui 9cde05f934 resolve merge conflicts 2026-04-23 11:25:43 +02:00
Marian Alexandru Alecu 1d0318b294 Merge branch 'main' into fix/queue-messages 2026-04-23 12:17:39 +03:00
kiloconnect[bot] 8c47af8af4 refactor(cli): reapply encoding changes after main merge
Main moved the Patch namespace out of packages/opencode/src/patch/index.ts
into patch/patch.ts and switched tool imports to the new
@opencode-ai/shared/filesystem and ../../src/tool barrels. Reapply the
encoding-aware read/write changes on top of the refactored patch.ts, and
update the integration test imports to match the new module layout.
2026-04-22 15:59:41 +00:00
kiloconnect[bot] 5a4aa91bfb Merge remote-tracking branch 'origin/main' into feat/encoding-preservation 2026-04-22 15:54:11 +00:00
Alex Alecu 6f5dbe050e Merge remote-tracking branch 'origin/main' into cli-suggest-non-blocking
# Conflicts:
#	packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
2026-04-22 17:54:46 +03:00
Alex Alecu f4c70554e8 Merge branch 'main' into fix/queue-messages 2026-04-22 17:54:33 +03:00
Alex Alecu 6d45e33efb core: auto-dismiss suggestion and question prompts once a new user message is queued, so a queued follow-up runs immediately instead of stalling behind a tool waiting on esc 2026-04-22 17:49:44 +03:00
Imanol Maiztegui e17c053fc8 style(imports): consolidate deep imports to use barrel re-exports
Replace granular submodule imports with their parent barrel index
across snapshot diff source and related test files. This covers
util/log, util/filesystem, config/config, provider/provider,
tool/registry, tool/truncate, and the filesystem shared package.
2026-04-22 15:58:25 +02:00
Imanol Maiztegui 5149d3edcb Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.4.7 2026-04-22 15:55:07 +02:00
Marian Alexandru Alecu 3bbe667c8c Merge pull request #9119 from Kilo-Org/fix/snapshot-diff-freeze
fix(cli): fix hanging sessions on huge-file diffs
2026-04-22 16:29:03 +03:00
Alex Alecu 5221569844 fix(cli): cover moved noReply line in kilocode_change block 2026-04-22 16:03:08 +03:00
Alex Alecu 311a73404b fix(cli): break after current stream instead of aborting on new prompt
Replace the state.cancel-based mid-turn injection with a break-after-stream
queue. When a new prompt arrives while the assistant is streaming, the current
LLM step now finishes cleanly, any pending suggest/question tool auto-dismisses
via Suggestion.dismissAll and the new Question.dismissAll, and runLoop breaks
out before the next LLM step via KiloSessionPromptQueue.hasFollowup. Queued
prompts still run in order, each getting a full turn unless a newer one
arrives during it.
2026-04-22 16:00:12 +03:00
Alex Alecu cdd5dc095d Merge remote-tracking branch 'origin/main' into cli-suggest-non-blocking 2026-04-22 15:25:33 +03:00
Alex Alecu c5ca657306 fix(cli): bind reservation owner 2026-04-22 13:49:26 +03:00
Imanol Maiztegui 27028fe292 fix(provider): update adaptive efforts, gateway support, and test corrections
Extract inline Opus 4.7 adaptive effort logic into anthropicAdaptiveEfforts
helper, extend smallOptions to recognize Kilo Gateway alongside OpenRouter,
fix LSP test file path from lsp/index.ts to lsp/lsp.ts, and update xhigh
variant assertion to include display: "summarized".
2026-04-22 10:18:05 +02:00
Imanol Maiztegui f117020215 fix(test): correct config module import to namespace import
Change named import to namespace import for the Config module in
custom-provider-delete test to align with how the module exports
its members.
2026-04-22 09:46:29 +02:00
Imanol Maiztegui 87c2b560d1 Merge branch 'main' into imanolmaiztegui/kilo-opencode-v1.4.7 2026-04-22 09:44:37 +02:00
Alex Alecu d500a983b9 fix(cli): reserve latest injected prompt 2026-04-22 09:54:17 +03:00
Alex Alecu c032fc2021 fix(cli): cap per-turn compaction attempts to stop infinite busy loop
When every compaction round still overflowed the model context, SessionPrompt.runLoop would keep calling compaction forever and report the turn as completed. Cap attempts at three per turn and surface exhaustion as a ContextOverflowError on the assistant message with TurnClose reason=error.
2026-04-22 09:54:11 +03: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
Imanol Maiztegui 251ed67347 refactor(opencode): update internal import paths to use barrel re-exports
Migrate all deep import paths across source and test files to
reference barrel index modules instead of direct file paths. This
covers config, provider, storage, util, tool, lsp, project, and
installation modules. Also moves provider promise helpers out of the
namespace block, switches Clipboard to namespace import style, fixes a
duplicate Filesystem import, removes the deleted paste-summary test,
and corrects snapshot cache typing and indentation.
2026-04-22 07:24:09 +02:00
Imanol Maiztegui 094ebe7e74 build(deps): consolidate @opencode-ai/util and @opencode-ai/server into @opencode-ai/shared
Remove the standalone `packages/util` and `packages/server` workspace
packages, migrating all imports across app, kilo-ui, opencode, and ui
to use `@opencode-ai/shared/util/*` paths instead. Also fix the
VITE_KILO_CHANNEL env variable name in the type declaration and add a
null guard in the titlebar channel badge rendering.
2026-04-21 18:33:48 +02:00
kiloconnect[bot] cce5e459bc refactor(cli): self-review — tighten markers, fix detection edge cases
- Encoding.detect: lowercase-compare UTF-32 rejection so jschardet's
  uppercase 'UTF-32'/'UTF-32BE'/'UTF-32LE' labels no longer slip through
  (iconv-lite happens to have utf-32 codecs that would then be accepted).
- Encoding.read: drop redundant Buffer.from wrap around readFile's
  already-Buffer return value.
- EncodedIO: switch to Effect.tryPromise so I/O failures surface as
  typed errors that .pipe(Effect.catch(...)) can recover from; the
  apply_patch delete branch relies on this to translate read errors
  into 'apply_patch verification failed'.
- Shrink kilocode_change blocks in edit.ts, write.ts, apply_patch.ts,
  patch/index.ts, and read.ts to per-line inline markers where each
  block was only wrapping 1-3 changed lines.
- Collapse the 'if (exists) { let contentOld; let encoding; ... }'
  blocks in edit.ts and write.ts into a single ternary + destructure
  that keeps all three lines self-contained and each independently
  annotated.
- Remove the unused 'latin1' sample and fix the 'providEncoded' typo
  in the encoding integration test file.
- Strengthen the apply_patch Shift_JIS test to assert exact bytes
  instead of the weak 'does not contain these two UTF-8 bytes' check.
- Drop the stray .kilo/ and .kilocode/ lockfiles that were re-added
  by an upstream 'wip' commit.
2026-04-21 16:18:47 +00:00
Alex Alecu 0bda9d15ed fix(cli): restore mid-turn injection 2026-04-21 19:17:02 +03:00
Imanol Maiztegui d5357f3961 resolve merge conflicts 2026-04-21 18:03:34 +02:00
kiloconnect[bot] adc82a0f02 Merge remote-tracking branch 'origin/main' into feat/encoding-preservation 2026-04-21 16:02:33 +00:00
kiloconnect[bot] 5538fc9c32 feat(cli): preserve UTF-8 BOM through read/write round-trip
iconv-lite's utf-8 codec strips any leading BOM on decode and never emits
one on encode, so files that started with EF BB BF would lose their BOM
after an edit. Track UTF-8-with-BOM as a distinct synthetic encoding label
and re-prepend the BOM bytes on write so the round-trip keeps the file
byte-identical (modulo any actual edits).
2026-04-21 13:32:48 +00:00
kiloconnect[bot] fa08250d73 refactor(cli): restore streaming line read and tidy markers
- Restore the streaming createInterface loop in the `lines` helper so the
  diff against main stays small; decode bytes with iconv-lite up front and
  feed the resulting text through Readable.from.
- Drop 'new file' kilocode_change markers from files under kilocode/
  directories (those paths are exempt from the annotation check).
- Tighten the changeset copy to sound like a user-facing release note.
2026-04-21 13:15:30 +00:00