Commit Graph
14845 Commits
Author SHA1 Message Date
Alex Alecu 12c2d86c84 feat(cli): show open PR for current branch in sidebar 2026-04-23 16:46:22 +03:00
Mark IJbema 55fcb5725a Merge pull request #9403 from singhvishalkr/fix/log-history-path-duplication
fix(cli): stop doubling the log directory in rotating-file-stream history path
2026-04-23 11:09:37 +02:00
Marius 00ec003c11 perf(streaming): four fixes that unfreeze long-session streaming (#9341)
* perf(vscode): stop O(N) reactive cascade on every streaming token

The webview DataBridge wrapped the whole session Data shape in a
`createMemo`, whose body walked `store.parts[msg.id]` for every message
in the session family. Any single part mutation — i.e. every token
delta — invalidated the memo, produced a fresh POJO, and invalidated
every downstream consumer (including O(N) scans inside each mounted
SessionTurn). On a 200-message session a Chrome CPU profile showed
three back-to-back 440ms main-thread blocks per SSE batch, ~46% of
the time in Solid reactive runtime alone.

Expose `data` as a plain object with reactive getters over
`session.allMessages`/`allParts`/`allStatusMap` so consumers reading
`data.store.part[Y]` subscribe to only that key. Removes the now-unused
`familyData` helper and its interface/mock entries.

* perf(ui): drop TextShimmer JS timer — CSS-only animation

A createEffect inside TextShimmer ran clearTimeout + setTimeout on every
`active` prop change to gate the sweep animation via a `data-run`
attribute. During LLM token streaming in long sessions, `active` props
(bound to `pending()` / `running()` accessors) thrashed as tools
started/finished across many shimmer instances. CPU profile of a 7s
streaming window showed ~2,500 timer operations — 16% of the blocked
main-thread time.

Remove the effect and drive the animation purely from the `data-active`
attribute. The opacity transition on the shimmer char (220ms) already
handles the fade, so visual behavior is unchanged. Adds one static
regression guard and one runtime perf assertion (with happy-dom) that
toggling the prop 1000 times results in zero timer calls.

* perf(kilo-ui): skip layout reads in GrowBox watch-mode ResizeObserver

The GrowBox component wraps each assistant part and, when watch=true
(which is set on the currently-streaming text part), runs a
ResizeObserver that called body.getBoundingClientRect() via
targetHeight() on every body-size change. During streaming this fires
at ~60Hz and each call forces a synchronous layout. CPU profile of a
7s streaming window showed 1,362 gBCR samples (~9% of blocked
main-thread time) all attributable to this path.

Reuse the browser's pre-measured contentBoxSize / contentRect from the
observer entries — no extra layout read. Also skip sub-pixel updates
(<2px) that the spring absorbs imperceptibly anyway, cutting per-token
spring work when tokens add tiny height deltas.

* perf(ui): coalesce markdown parse to one per animation frame

During LLM token streaming, the Markdown render effect ran
temp.innerHTML = content + morphdom on every content update. SSE
tokens arrive at 60–200Hz and each delta reparsed the entire
accumulated HTML. CPU profile of a 7s streaming window showed 2,940
ParseHTML events totaling ~619ms (~46% of blocked main-thread time).

Queue the latest content in a component-scoped pending variable and
run the morphdom pass inside requestAnimationFrame. K rapid updates
before the frame fires now collapse to one parse. The onCleanup
handler cancels any queued frame so it doesn't touch an unmounted
DOM. Fast-path is preserved untouched so non-streaming first paint
stays synchronous.

* chore(changeset): consolidate streaming-perf changesets into one

Per-commit changesets produced four nearly-identical release-note
entries. The user-visible change is a single perceptual improvement —
streaming is smooth in long sessions — so roll them up into one
feature-oriented entry.

* test(vscode): consolidate streaming perf tests + wire into CI

Replace three synthetic reactivity tests with a single end-to-end
streaming perf benchmark that:
- Renders the real TextShimmer component and asserts zero setTimeout/
  clearTimeout calls during a 100-toggle burst (TextShimmer fix).
- Asserts per-key Solid reactivity: 100 text deltas on one message
  must re-run only that message's consumer, not O(N) consumers
  (DataBridge cascade fix).
- Uses only count-based assertions against deterministic APIs
  (setTimeout/clearTimeout/innerHTML setter) — no wall-clock
  thresholds, so it doesn't flake under CI load.

Also wire `bun run test:webview-reactivity` into the test-vscode
workflow so the benchmark runs on every PR that touches
packages/kilo-vscode, packages/ui, or packages/kilo-ui. Without this
wiring the perf regression guard would have shipped dormant.

* test(vscode): declare @happy-dom/global-registrator as devDep

The streaming-perf benchmark imports @happy-dom/global-registrator to
get a DOM for mounting the real TextShimmer component. It resolved
locally through workspace hoisting but CI's clean install didn't have
it. Make the dependency explicit.

* test(vscode): import TextShimmer via package export so JSX resolves

Using the deep relative path (../../../ui/src/components/text-shimmer)
made Bun's test transpiler apply kilo-vscode's tsconfig — which has no
`jsxImportSource` — so the .tsx file was compiled with the default
React runtime, producing "React is not defined" in CI.

Resolving through the package export (@opencode-ai/ui/text-shimmer)
picks up packages/ui/tsconfig.json which sets
`jsxImportSource: solid-js`. Works consistently across Linux/macOS/
Windows CI without needing bunfig-level JSX overrides.

* test(vscode): address bot review — add runtime coverage for Markdown + GrowBox, drop empty smoke test

Two kilo-code-bot findings on the streaming perf bench:

1. The 'benchmark completes quickly' smoke test timed an empty block,
   so `elapsed` was always near zero and the assertion never fired.
   Drop it — the real benchmarks below already complete in ~90ms.

2. The original file installed spy counters for innerHTML writes and
   getBoundingClientRect but never asserted against them, leaving
   Markdown rAF coalescing and GrowBox layout-read regressions silently
   uncaught.

Add two runtime mirrors:
- Markdown rAF pattern: 100 async content updates coalesce to <20 parses
  (would be exactly 100 pre-fix).
- GrowBox ResizeObserver pattern: 100 synthetic resize callbacks using
  contentBoxSize/contentRect trigger zero getBoundingClientRect calls
  (would be exactly 100 pre-fix).

Source-level regression guards in tests/unit/markdown-raf-coalesce.test.ts
and tests/unit/growbox-no-layout-thrash.test.ts cover the actual
component code. The runtime tests here prove the patterns the guards
require actually deliver the perf property at runtime.

Benchmark runs in ~90ms, 5 consecutive local runs all green.

* test(vscode): drop unstable TextShimmer runtime mount from streaming perf bench

The benchmark tried to mount the real @opencode-ai/ui TextShimmer to
assert zero setTimeout/clearTimeout calls. That required Bun's test
runner to transpile text-shimmer.tsx with Solid's JSX runtime, which
depends on tsconfig resolution walking up to packages/ui/tsconfig.json.
In CI (fresh workspace, different node_modules layout) this resolution
was unstable and kept falling back to React JSX ("React is not
defined").

Keep the three runtime patterns that don't need JSX transpilation
(DataBridge cascade, Markdown rAF coalescing, GrowBox contentRect),
plus the source-level regression guard at
tests/unit/textshimmer-no-timer.test.ts which asserts text-shimmer.tsx
contains no setTimeout/clearTimeout/createEffect/data-run. Together
these cover all four fixes without CI flakiness.

5 consecutive local runs pass in ~80ms.

* test(vscode): remove streaming perf tests

Static source-parsing guards and pattern-mirror runtime tests didn't
actually exercise the fixed component code — a regression in the real
code could have left them green. Remove them along with the
test:webview-reactivity script, the workflow step, the
@happy-dom/global-registrator devDep, and the tests/webview-reactivity
directory. The four perf fixes stand on their own; adding dubious
guards was worse than adding none.

* test(vscode): restore static perf-regression guards wired to real source

Restore four guards that each parse the actual fixed component source
and fail loudly if the fix pattern is removed:

- databridge-shape.test.ts     reads webview-ui/src/App.tsx, asserts
                               `data` is not wrapped in createMemo
- textshimmer-no-timer.test.ts reads ui/src/components/text-shimmer.tsx
                               + .css, asserts no setTimeout/
                               clearTimeout/createEffect, animation
                               gated on data-active
- markdown-raf-coalesce.test.ts reads ui/src/components/markdown.tsx,
                                asserts the render createEffect uses
                                requestAnimationFrame + cancelAnimationFrame
- growbox-no-layout-thrash.test.ts reads kilo-ui/src/components/grow-box.tsx,
                                   asserts the ResizeObserver callback
                                   does not call gBCR, uses contentRect/
                                   contentBoxSize, and has the sub-pixel
                                   delta guard

Verified by mutation: each guard fails when its fix pattern is removed
from the real source file and passes again once restored. Runs as part
of the existing test:unit script (no extra CI wiring).
2026-04-23 10:40:15 +02:00
Mark IJbema 33fa8cfc19 Merge pull request #9364 from Kilo-Org/fix/disable-single-dollar-math
fix(ui): disable single-dollar LaTeX math to preserve currency symbols
2026-04-23 10:39:50 +02: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
kiloconnect[bot] 066a56529c docs: remove claw mode from kilo-auto frontier documentation
claw is not a user-facing mode
2026-04-22 21:36:30 +00:00
kiloconnect[bot] b2c9467a88 docs: update kilo-auto model routing documentation
- Add claw mode to frontier tier's Opus routing table
- Update balanced tier: routes by API interface type (Completions→Qwen3.6+, Responses→GPT-5.3-Codex, Messages→Claude Haiku 4.5)
- Update free tier: remove hardcoded 80/20 split, describe dynamic server-side routing
2026-04-22 21:33:09 +00: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
Mark IJbema b24c144198 fix(ui): prevent single-dollar math fallback 2026-04-22 18:00:05 +02:00
kiloconnect[bot] 62f374e628 fix(ui): disable single-dollar LaTeX math to preserve currency symbols
Single $ delimiters in agent responses (e.g. $93K, $307K) were being
interpreted as inline LaTeX math by marked-katex-extension, garbling
dollar amounts. Override the inlineKatex tokenizer to never match and
remove the regex-based single-dollar rendering in renderMathInText.
Display math ($$...$$) is preserved.
2026-04-22 15:40:09 +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
kiloconnect[bot] e0a618c3fe docs: remove #1 on OpenRouter claim from taglines 2026-04-22 14:14:46 +00:00
Imanol Maiztegui 57630eaf17 Merge pull request #9346 from Kilo-Org/imanolmaiztegui/kilo-opencode-v1.4.7
OpenCode v1.4.7
2026-04-22 16:10:29 +02:00
github-actions[bot] 0c2f995877 chore: update kilo-vscode visual regression baselines 2026-04-22 14:00:57 +00: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
kirillk cad39b92b3 Merge remote-tracking branch 'origin/main' into small-taleggio 2026-04-22 09:48:06 -04:00
kirillk fb0072a134 fix(jetbrains): use shared root logger in FileLog to prevent duplicate handlers 2026-04-22 09:41:46 -04: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
Kirill Kalishev d147f782f7 Merge pull request #9335 from Kilo-Org/productive-move
fix(vscode): restore explicit submit for question dock
2026-04-22 08:59:24 -04:00
Mark IJbema 03a2eb9d91 Merge pull request #9353 from Kilo-Org/fix/ovsx-publish-retry
fix(vscode): retry Open VSX publish on transient failures
2026-04-22 14:41:49 +02: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
kiloconnect[bot] 0cc0cf2aa0 fix(vscode): retry Open VSX publish on transient failures 2026-04-22 12:00:26 +00: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
Mark IJbema 45b9923fc9 Merge pull request #9319 from Kilo-Org/mark/fix-fim-upstream-timeout
fix(gateway): timeout autocomplete fim streams
2026-04-22 12:10:21 +02: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
kiloconnect[bot] 7284040092 refactor(gateway): simplify FIM timeout using AbortSignal.any
Replace custom timeout() and stream() helpers with platform
AbortSignal.any + AbortSignal.timeout (available since Node 20.3).
Eliminates ~50 lines of manual signal management and stream wrapping.
2026-04-22 09:24:19 +00: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
Mark IJbema d8294f4b87 Merge pull request #9331 from Kilo-Org/docs/generated-screenshot-refs
Reference generated screenshots in docs
2026-04-22 09:57:57 +02:00
Imanol Maiztegui 5791061abf fix(proxy): await async isSyncing check in server proxy 2026-04-22 09:52:37 +02:00
Imanol Maiztegui cda900568c docs(source-links): update file path references for model-id and tui-migrate modules
Correct source comment annotations to reflect relocated modules:
- config.ts → config/model-id.ts for model schema link
- config/tui-migrate.ts → cli/cmd/tui/config/tui-migrate.ts for tui.json link
2026-04-22 09:49:22 +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
kiloconnect[bot] 79ba90ec8e fix(kilo-docs): keep docsearch links on previews 2026-04-22 06:47:56 +00: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
kiloconnect[bot] 1739c430fb docs: document generated screenshot guidance 2026-04-22 06:39:15 +00: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
github-actions[bot] 1b3c23734c chore: update kilo-vscode visual regression baselines 2026-04-22 06:27:36 +00:00