Commit Graph

5007 Commits

Author SHA1 Message Date
Christiaan Arnoldus 3be1cd6e42 Merge branch 'main' into feat/encoding-preservation 2026-04-23 14:33:07 +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
Josh Holmer 10e8ebb5e1 fix(cli): log stream error on log rotation 2026-04-22 21:05:29 -04:00
Marius 48c0553bb7 feat(vscode): xterm.js terminal tabs in agent manager (#9268)
Click the chevron next to the + tab button and pick 'New Terminal' (or hit Cmd+Shift+T / Ctrl+Shift+T) to spawn a real shell inside the selected worktree or Local directory. Each terminal runs via the Kilo CLI's PTY backend, streamed over a direct loopback WebSocket so raw bytes bypass postMessage. Tabs mirror the worktree split-button pattern, support mixed drag-reorder with session tabs, and survive worktree-context switches without losing xterm state (slots are opacity-toggled in a persistent absolute-positioned layer, never unmounted). The legacy Cmd+/ integrated-terminal shortcut and console icon are preserved so existing muscle memory keeps working.
2026-04-22 16:20:40 +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] 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
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
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
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
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 5791061abf fix(proxy): await async isSyncing check in server proxy 2026-04-22 09:52:37 +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 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
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
kiloconnect[bot] 4d6ba91593 Merge branch 'main' into feat/encoding-preservation 2026-04-21 12:07:17 +00: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
Alex Alecu e696fe6ea4 fix(cli): inject plan message immediately, append handover in-place
Show the plan text right away in the new session tab without waiting
for the handover LLM call. The message part is created with plan+todos
as soon as the session opens; the handover section is upserted onto the
same part once the slow LLM call resolves.
2026-04-21 13:28:48 +03:00
Christiaan Arnoldus b99e7ff513 Apply suggestion from @chrarnoldus 2026-04-21 12:24:46 +02:00
Alex Alecu ce50f5cc62 core: preserve upstream Myers diff code to keep upstream merges clean
The previous commit deleted ~150 lines of upstream OpenCode diff code because the git-based path always runs first. Restoring those lines as dead code (behind an early-return kilocode_change block) keeps our diff from upstream minimal, so future OpenCode syncs to the hot diffFull code path don't conflict. No runtime behavior change — the git-based DiffFull path still short-circuits before the restored Myers loop executes.
2026-04-21 13:19:30 +03:00
kiloconnect[bot] e28bbd6ee9 Merge remote-tracking branch 'origin/main' into feat/ling 2026-04-21 09:51:41 +00:00
kiloconnect[bot] 85dd7e091b refactor: share isLing helper via kilocode/model-match, add multilingual exclusion 2026-04-21 09:43:57 +00:00
kiloconnect[bot] eb4ef74600 refactor: replace broad ling startsWith with isLing helper excluding kling/bling/spelling 2026-04-21 09:33:23 +00:00
Alex Alecu a5946abe3d core: drop the JavaScript diff fallback that's no longer needed
The git-based diff path has been reliable across all tests and in production since the TUI-freeze fix shipped. Removing the JS Myers fallback eliminates ~220 lines of belt-and-suspenders code (a size-cap guard, a git cat-file blob loader, and a per-file git show fallback). If git ever fails now, callers emit an empty patch string; additions/deletions from git --numstat still come through unchanged.
2026-04-21 12:07:56 +03:00
kiloconnect[bot] fe34c0bfe6 fix: use startsWith for ling model detection and add ling to openapi prompt enum 2026-04-21 09:04:34 +00:00