Commit Graph

6157 Commits

Author SHA1 Message Date
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
kiloconnect[bot] e84ea3afc6 refactor(cli): self-review post-merge cleanup in apply_patch
- Drop the dead 'encoding = pre.encoding' initial value that was only
  read if deriveNewContentsFromChunks threw, and that code path
  returns before encoding is ever used.
- Inline pre.text into the read line so we don't bind a 'pre' local
  just to destructure it once.
2026-04-22 16:05:46 +00: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 310343e7ce chore(cli): mark blockingSuggestion as kilocode change 2026-04-22 18:05:16 +03: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
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
Imanol Maiztegui 92f1c1daba refactor(tui,provider): raise paste-summary thresholds, improve copilot auth error, and clean up comments
Increase paste-summary trigger from 3 lines/150 chars to 5 lines/800
chars to reduce unnecessary summarization on small pastes. Add a branded
reauthentication hint when GitHub Copilot returns 403. Guard against
empty agent list during org switch in the model auto-update effect and
reformat multi-line ternary for readability. Relocate inline comment on
mercury exclusion in reasoning effort variants.
2026-04-22 15:50:55 +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
Marian Alexandru Alecu 740c2b4e8b Merge pull request #9344 from Kilo-Org/fix/infinite-compact
fix(cli): cap per-turn compaction attempts
2026-04-22 16:10:11 +03:00
kiloconnect[bot] dfbdc97cd3 refactor(cli): simplify isBinaryFile check to UTF-16 BOM only
Per review: CJK and legacy single-byte encodings already passed the old
control-char heuristic (their bytes are all >= 0x80, never NUL), so the
full Encoding.detect pass in isBinaryFile was solving a non-problem for
them. The only realistic regression in the old heuristic is UTF-16 with
BOM, where the second byte of every ASCII character is 0x00 and fires
the NUL-byte early-return.

Replace the detect call with a 2-byte BOM check via a new
Encoding.hasUtf16Bom helper. Also reword the move/add inline markers in
patch/index.ts to note that Encoding.write handles mkdir.
2026-04-22 13:05:31 +00:00
kilo-maintainer[bot] eb7bd75d6d release: v7.2.20 2026-04-22 12:30:54 +00: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 188d71e0ed chore(cli): annotate kilocode sdk import 2026-04-22 15:07:36 +03:00
kilo-maintainer[bot] 475f836904 release: v7.2.19 2026-04-22 11:42:59 +00:00
Alex Alecu 40cb8889fe tui(cli): redesign inline suggest bar to match VS Code single-row layout
Replaces the number-prefixed question-picker block with a full-width tinted
row: icon + suggestion text on the left, clickable action buttons on the
right. Removes keyboard shortcuts and the esc-dismiss hint -- dismissal
already happens automatically server-side when the user sends a new prompt.
2026-04-22 14:24:56 +03:00
kilo-maintainer[bot] fe76dffa50 release: v7.2.18 2026-04-22 10:51:47 +00:00
Alex Alecu e7bcc93ebb tui(cli): make suggest renderer reactive so the inline bar actually appears
Previously, the non-blocking inline SuggestBar never showed up because the
Suggest component used an early-return if/else that ran once at mount
(when no pending request existed yet) and never re-evaluated when the
suggestion arrived. Users saw 'Suggesting next step...' forever with no
way to accept or dismiss, which felt like the suggestion was blocking
the session again. Switching to <Switch>/<Match> so the branch updates
when the request lands makes the bar appear and be interactive.
2026-04-22 13:08:00 +03:00
Imanol Maiztegui f373e0d06a fix(cli): handle EADDRINUSE race in mcp oauth callback server
Parallel bun test subprocesses can race between isPortInUse() and
listen(), causing the loser to crash with EADDRINUSE. Treat that error
as 'another instance owns the port' (same semantics as the isPortInUse
branch above) so the auto-connect test stops flaking in CI.
2026-04-22 10:41:42 +02: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 23167b8b6a refactor(test): replace direct Config.get assignment with spyOn mocking
Swap manual save-and-restore of Config.get for bun:test spyOn/mock.restore
across session-list and recall test suites, ensuring proper mock teardown
and consistent namespace imports.
2026-04-22 10:02:40 +02:00
Imanol Maiztegui 5791061abf fix(proxy): await async isSyncing check in server proxy 2026-04-22 09:52:37 +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
Imanol Maiztegui ea09e76048 refactor(sdk): reorder generated types and fix route chaining in instance handler
Alphabetically sort import statements in the SDK codegen output and
reposition type declarations (EventInstallationUpdated,
EventSessionTurnOpen, SessionStatus, Todo, etc.) to match updated
code generation ordering. In the server instance router, assign the
chained route builder to a `full` variable before passing it to
`registerKiloRoutes` for clarity.
2026-04-22 09:18:55 +02:00
Alex Alecu 8d06a083bc tui(cli): render non-blocking suggestions inline in the conversation
Moves the 'Run review?' suggestion picker out of the footer bar above the
prompt and into the conversation itself, at the position of the suggest
tool call. Frees up vertical space for reading while scrolling and
matches where the VS Code extension shows the same picker. Clicking an
option still accepts, digit keys 1/2 fast-accept when the prompt isn't
focused, and Esc dismisses. Blocking suggestions keep the above-prompt
overlay.
2026-04-22 09:59:02 +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 324ee79f33 build(deps): upgrade OpenTelemetry packages to v2 and sort dependencies
Bump @opentelemetry/core, sdk-trace-base, sdk-trace-node, and
resources from 1.30.x to 2.6.1 and semantic-conventions from 1.28.0
to 1.40.0 in kilo-telemetry. Migrate to the new v2 API surface:
replace `new Resource()` with `resourceFromAttributes()`, rename
`parentSpanId` to `parentSpanContext`, and rename
`instrumentationLibrary` to `instrumentationScope` in span types and
tests. Alphabetically sort dependency entries in the opencode
package.json.
2026-04-22 08:45:19 +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
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
Kirill Kalishev 2a963723cc Merge pull request #9280 from Kilo-Org/quilted-titanosaurus
fix(cli): restore model descriptions in expanded model picker
2026-04-21 16:34:58 -04: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
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
Marian Alexandru Alecu ed665ed960 Merge pull request #9300 from Kilo-Org/fix/plan-in-agent-manager
fix(agent-manager): start-new-session tab on slow handover
2026-04-21 17:38:47 +03:00
kilo-maintainer[bot] ba98c5c402 release: v7.2.17 2026-04-21 14:28:13 +00:00
kiloconnect[bot] 6f55a3061d refactor(cli): restore stream.destroy and keep original comments
- Wire Readable.from through a named `stream` variable so the `lines`
  helper can destroy it in the finally block, matching the previous
  createReadStream pattern.
- Restore the 'Create parent directories', 'Handle file move', 'Regular
  update', 'Read original file content', and 'For delete, we need to read
  the current content' comments that were dropped when switching to
  Encoding.write / Encoding.read. The explicit fs.mkdir calls are no
  longer needed because Encoding.write mkdirs recursively, but the intent
  comments still apply.
2026-04-21 14:04:35 +00:00
Alex Alecu 925606ce5a fix(cli): clear pending on errors 2026-04-21 16:54:16 +03:00
Alex Alecu 2f6109a5a2 fix(cli): guard follow-up loop start 2026-04-21 16:33:05 +03: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
kiloconnect[bot] 526f6807ff test(cli): add integration tests for tool encoding preservation
Exercise Read/Write/Edit/ApplyPatch tools directly against files in
UTF-8, UTF-16 LE/BE (with BOM), Shift_JIS, EUC-JP, GB2312, Big5, EUC-KR,
Windows-1251, and KOI8-R to verify the tools decode input correctly and
round-trip bytes back to the original encoding. Also ensure UTF-16
BOMs survive the write pipeline.
2026-04-21 12:40:56 +00:00
kiloconnect[bot] a2926207f9 refactor(cli): simplify encoding detection and isolate helpers
Drop manual BOM parsing, UTF-32, and UTF-16-without-BOM detection: rely on
TextDecoder + jschardet + iconv-lite which already handle BOM round-tripping
for UTF-16 LE/BE. Move the encoding helpers and Effect wrappers into
packages/opencode/src/kilocode/ so shared tool files only carry targeted
kilocode_change markers.
2026-04-21 12:25:53 +00:00
Evgeny Shurakov c0e9ab46b3 Merge pull request #9313 from Kilo-Org/eshurakov/cli-dev-local-script
Cli - Add dev:local script for isolated local development
2026-04-21 14:17:43 +02:00
kiloconnect[bot] 4d6ba91593 Merge branch 'main' into feat/encoding-preservation 2026-04-21 12:07:17 +00:00
Evgeny Shurakov a8803476f5 feat(cli): add dev:local script with isolated XDG dirs and local endpoints 2026-04-21 13:49:55 +02:00
Alex Alecu b6b6802dd4 fix(cli): keep follow-up session busy during handover
Mark new plan follow-up sessions busy as soon as the tab opens so the UI
shows work is still in progress while the handover summary is generated.
Clear the temporary busy state if that pre-loop handover phase is aborted
or fails before the normal prompt loop takes over.
2026-04-21 14:46:06 +03:00
Alex Alecu c5a83b3cc9 fix(cli): align non-blocking suggest picker behavior
Remove the synthetic Dismiss row and let Esc dismiss suggestions so the picker matches its visible controls while the main input stays active.
2026-04-21 14:43:26 +03:00