Commit Graph

5109 Commits

Author SHA1 Message Date
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
Alex Alecu 418fe78f5d fix(cli): sync processor cost after subagent propagation
finish-step and cleanup previously re-wrote the parent assistant message with a stale in-memory cost, clobbering the subagent cost written by task.ts during tool execution. Refresh from DB before each write so the propagated cost is preserved across steps. Verified live via side-by-side `kilo serve` vs dev `bun serve` with 2 parallel subagents; parent now shows own LLM + children, matching real spend.
2026-04-24 18:05:45 +03:00
Alex Alecu ae0c437791 fix(cli): serialize concurrent subagent cost propagation 2026-04-24 07:26:09 +03:00
Alex Alecu 73ab363f9a 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-24 06:17:02 +03:00
Josh Lambert fa9be90915 feat(cli): allowlist gpt-5.5 in Codex OAuth plugin 2026-04-23 17:48:04 -04:00
kirillk fd9d5ca739 fix(cli): add local jschardet module declaration for typecheck
Add a minimal ambient module declaration for jschardet so the repo
pre-push typecheck hook passes in worktrees where upstream dependency
typings are not resolved by tsgo.
2026-04-23 13:22:53 -04:00
kiloconnect[bot] c4df6b80cb chore(cli): refine kilocode_change markers on encoding-preservation code
Narrow overly-broad blocks, combine adjacent single-line markers, and
expand inline comments to note what the replaced upstream code did.
2026-04-23 14:28:12 +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
Marian Alexandru Alecu dbe0f920a8 Merge pull request #9332 from Kilo-Org/fix/queue-messages
fix(cli): fix queued messages
2026-04-23 17:18:37 +03: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
Marian Alexandru Alecu 5b5425cc32 Merge pull request #9408 from Kilo-Org/fix/suggest-review-prompt
fix(cli): narrow when suggest offers review
2026-04-23 16:39:10 +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
Christiaan Arnoldus 3be1cd6e42 Merge branch 'main' into feat/encoding-preservation 2026-04-23 14:33:07 +02: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
Alex Alecu 2285bd0831 fix(cli): align suggest gate with commands 2026-04-23 13:12:08 +03: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
Alex Alecu c214d63afb fix(cli): narrow when suggest offers a local code review
Stops the suggest tool from surfacing a local-review prompt after PR-comment replies, reactive fixes, trivial edits, non-implementation work, or review-adjacent turns. Tool description and system prompt now share one explicit gate: only suggest when the user initiated implementation and the diff is substantial.
2026-04-23 12:41:07 +03: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
Alex Alecu d0e109dcb6 refactor(cli): move question dismissAll to kilocode file 2026-04-23 11:29:37 +03:00
Alex Alecu a9107539e3 refactor(cli): move question tool dismissed helpers to kilocode file 2026-04-23 11:29:30 +03:00
Vishal Kumar Singh 03a1285c69 fix(cli): stop doubling the log directory in rotating-file-stream history path
On every kilo CLI startup the process writes an error like:

    log stream error: ENOENT: no such file or directory, open
    '<log-dir>/<log-dir>/.log-history'

Log rotation is effectively disabled because rotating-file-stream cannot
open its history file.

Root cause: rotating-file-stream (3.2.x) treats the `history` option as
a filename resolved against the `path` option. In
`packages/opencode/src/util/log.ts` we were passing an absolute path
(`path.join(dir, '.log-history')`) for `history` while also setting
`path: dir`, so the library concatenated the two and produced the
`<dir>/<dir>/.log-history` path that ENOENTs.

Passing the relative filename `.log-history` lets the library resolve
the history file under the configured `path` directory, matches the
docs, and restores the 50 MB / 10-file rotation cap.

Fixes #8252
Fixes #8275
Fixes #9321
2026-04-23 13:07:01 +05:30
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 d5492f4765 fix(cli): mark dismissed question as blocked 2026-04-22 17:58:33 +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
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 aeb800dd47 refactor: kilo compat for v1.4.9 2026-04-22 16:17:14 +02: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 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 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 c5ca657306 fix(cli): bind reservation owner 2026-04-22 13:49:26 +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