Commit Graph

1110 Commits

Author SHA1 Message Date
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
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
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 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
Alex Alecu 0d0dabe598 fix(cli): start-new-session tab on slow plan handover
Create the follow-up session before running the handover LLM call so
the extension's pendingFollowup SSE gate fires inside its 30s TTL. The
handover and todos are now injected into the already-live session
after it resolves, instead of blocking session creation.
2026-04-21 11:50:13 +03:00
Alex Alecu 00ad8f9c87 Merge remote-tracking branch 'origin/main' into fix/plan-followup-translations
# Conflicts:
#	packages/kilo-vscode/tests/unit/question-dock-utils.test.ts
#	packages/kilo-vscode/webview-ui/src/components/chat/QuestionDock.tsx
#	packages/kilo-vscode/webview-ui/src/components/chat/question-dock-utils.ts
#	packages/opencode/src/kilocode/plan-followup.ts
#	packages/opencode/test/kilocode/plan-followup.test.ts
2026-04-20 18:09:05 +03:00
Alex Alecu df44d3847d fix(cli): keep older queued prompts hidden on retarget 2026-04-20 17:26:54 +03:00
Alex Alecu b25843962d fix(cli): restore "Type your own answer" on plan follow-up in TUI
When the plan agent pauses for the follow-up question, CLI users had no
way to send a free-text reply: the main prompt input is hidden while a
blocking question is active, and the "Type your own answer" row was
being forced off to avoid duplicating the VS Code prompt input. CLI now
shows the custom-answer row again, while VS Code keeps it hidden.
2026-04-20 17:16:48 +03:00
Alex Alecu 64e2f096c4 fix(cli): make plan follow-up "Continue here" continue the loop
The prompt queue's scope() hid the user message injected by
PlanFollowup.inject() because its ID was newer than the queue target,
so the loop saw the same plan_exit messages and re-asked the question
in an infinite cycle. Retarget the queue after inject so the new
message is visible on the next iteration.
2026-04-20 17:16:48 +03:00
Alex Alecu ec5ac2e19f fix(vscode,cli): make plan_exit "Continue here" work again
Restore custom: false on the plan follow-up question — the "Type your own answer" row was redundant because the main prompt already routes typed text as a question reply. Auto-submit single-question single-select option picks in the VS Code QuestionDock so the button behaves like the TUI instead of silently waiting for a second Submit click.
2026-04-20 17:16:48 +03:00
Alex Alecu c529142d72 feat(i18n): translate plan_exit follow-up options in the VS Code sidebar
Add optional `labelKey`/`descriptionKey` to Question.Option and `questionKey`/`headerKey` to Question.Info, annotated with `kilocode_change` markers. Populate these keys from the plan follow-up so the "Ready to implement?" question, "Start new session", and "Continue here" buttons render in the sidebar language while the canonical English labels remain on the reply wire (unchanged server-side matching).
2026-04-20 16:15:06 +03:00
Marius 2b17a7b4e8 fix: persist custom provider model and variant deletions (#9239)
* fix: persist custom provider model and variant deletions

The CLI config.update endpoint deep-merges its payload with existing
global config, so removing a model or reasoning variant from a custom
provider in the UI had no effect on disk. Save payloads now emit null
sentinels for removed IDs, and the Provider schema accepts nullable
record values so stripNulls can delete them during the merge.

Closes #9186

* chore: update kilo-vscode visual regression baselines

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-20 13:05:49 +00:00
Alex Alecu f970d34278 fix(vscode,cli): make plan_exit "Continue here" work again
Restore custom: false on the plan follow-up question — the "Type your own answer" row was redundant because the main prompt already routes typed text as a question reply. Auto-submit single-question single-select option picks in the VS Code QuestionDock so the button behaves like the TUI instead of silently waiting for a second Submit click.
2026-04-20 14:56:40 +03:00
Evgeny Shurakov 214496f679 Merge pull request #8494 from Kilo-Org/eshurakov/nebula-chauffeur
Sessions - Add session_status ingest message for status tracking
2026-04-20 13:06:45 +02:00
Alex Alecu 58fd32937d test(cli): pin suggest tool session-status behavior to prevent stuck-busy regression
Lock in that a session with an open suggestion reports as idle (so reopening VS Code or switching worktrees does not show it stuck/running), that accepting flips it back to busy without an idle flash, and that a dismissed suggestion leaves it idle for the run loop to resume cleanly.
2026-04-20 13:57:14 +03:00
Evgeny Shurakov 193839329b feat(sessions): add session_status ingest message for status tracking 2026-04-20 09:13:17 +02:00
Imanol Maiztegui 8bae4413fd test(bash): migrate permission metadata tests to Effect runtime
Replace raw async/Promise-based test helpers with Effect-based
equivalents to align with the upstream BashTool API changes. Introduce
a ManagedRuntime composed of CrossSpawnSpawner, AppFileSystem, Plugin,
Truncate, and Agent layers. Update metadata, ask, and execute call
sites to return Effect values instead of plain promises.
2026-04-17 22:54:14 +02:00
Imanol Maiztegui 2ee8394cf1 feat: add workspace API endpoints, sanitize export flag, and update SDK types
Add experimental workspace adaptor list and status endpoints to the
OpenAPI spec. Add --sanitize flag to CLI export command for redacting
sensitive data. Update SDK types to reorder session status types before
suggestion types. Remove deprecated /global/sync-event endpoint.

Includes formatting fixes across i18n files, opencode source, and
tests, plus a warpgrep import path correction.
2026-04-17 22:51:24 +02:00
Imanol Maiztegui 5a2789167f Merge branch 'main' into johnnyamancio/kilo-opencode-v1.4.4 2026-04-17 22:35:10 +02:00
Johnny Amancio 2172616229 fix: Remove Bash string appearing before commands - brought back on earlier opencode merge 2026-04-17 20:17:57 +02:00
kiloconnect[bot] b9c8970b21 chore: resolve merge conflicts with main 2026-04-17 14:37:19 +00:00
Marius c8fd421823 fix(vscode): restore sidebar diff viewer parity with Agent Manager (#9121)
* fix(vscode): restore sidebar diff viewer parity with Agent Manager

The sidebar diff viewer bundle was missing agent-manager-review.css, so
FullScreenDiffView rendered with a broken file tree (no flex layout, no
revert styles) since PR #7455. Co-locate the CSS imports with the
component so every consumer gets them automatically, and wire per-file
revert end-to-end via a shared WorktreeDiffClient used by both the
sidebar provider and the Agent Manager controller.

* fix(cli): skip flaky shell-completion test on Windows CI

The 'shell completion resumes queued loop callers' test relies on shell
process spawn timing that is unreliable on Windows CI and times out at
3s. Every other shell-process test in this file already uses the
existing `unix(...)` helper for the same reason — align this test
with that pattern.
2026-04-17 14:12:19 +02:00
Christiaan Arnoldus 11343c4473 Merge pull request #9067 from Kilo-Org/fix/queued-prompt-reorder
fix(cli): move queued user prompts to end of history
2026-04-17 13:55:38 +02:00
Marian Alexandru Alecu 852b52e846 Merge pull request #9118 from Kilo-Org/kilocode-model-switcher
fix(cli): preserve per-agent model overrides
2026-04-17 14:43:48 +03:00
Johnny Amancio 3c7b0a7d3c fix: Regenerage sdk and port tests to new v1.4.4 style 2026-04-17 12:47:27 +02:00
Johnny Amancio 0c3e31f6d2 Merge remote-tracking branch 'origin/main' into johnnyamancio/kilo-opencode-v1.4.4 2026-04-17 12:23:18 +02:00
Marius 4ef6bbff50 feat(agent-manager): enable /sessions command to browse and resume session history (#8976)
* feat(agent-manager): enable /sessions command to browse and resume session history

* fix(agent-manager): prevent duplicate tabs when selecting already-open session from history

* fix(agent-manager): preserve tab memory when reopening local history sessions

* docs(vscode): add agent manager sessions changeset

* fix(cli): eliminate mock.module race in commit-message tests

git-context.test.ts and generate.test.ts both called mock.module on
the same path. Bun mock.module is process-wide and permanent, so
whichever file loaded second saw the other's mock. Replace with
injectable test seams (setGitRunnerForTest, setGitContextForTest) that
are cleaned up in afterEach.

* test(cli): retry model json reads during async persistence

* fix(agent-manager): hide review tab when picking session from history

Also revert the commit-message test seam refactor — upstream rewrote
git-context.test.ts to use real git repos and the test runner isolates
each file in its own process, so the mock.module race no longer exists.

* docs(vscode): bump agent manager sessions changeset to minor
2026-04-17 10:21:47 +00:00
Marius 530125828e Add folder mentions (#9023)
* feat(vscode): add folder mentions

* fix(vscode): harden folder mentions

* refactor(vscode): tighten folder mention plumbing

* fix(cli): annotate kilo-specific read.ts exports
2026-04-17 11:59:31 +02:00
Alex Alecu 343455b878 fix(cli): preserve per-agent model overrides (#9050)
Gate the agent-change auto-apply effect on model.json load and skip it when a per-agent pick already exists, so user-selected models for agents with a configured default no longer revert on agent switches or restarts.
2026-04-17 12:47:35 +03:00
Alex Alecu 9dfa2ae352 Merge remote-tracking branch 'origin/main' into kilocode-suggest-code-review
# Conflicts:
#	bun.lock
#	package.json
#	packages/app/package.json
#	packages/desktop-electron/package.json
#	packages/desktop/package.json
#	packages/extensions/zed/extension.toml
#	packages/kilo-docs/package.json
#	packages/kilo-gateway/package.json
#	packages/kilo-i18n/package.json
#	packages/kilo-telemetry/package.json
#	packages/kilo-ui/package.json
#	packages/kilo-vscode/CHANGELOG.md
#	packages/kilo-vscode/package.json
#	packages/kilo-vscode/src/KiloProvider.ts
#	packages/kilo-vscode/webview-ui/src/context/session.tsx
#	packages/opencode/CHANGELOG.md
#	packages/opencode/package.json
#	packages/opencode/src/session/prompt.ts
#	packages/plugin/package.json
#	packages/script/package.json
#	packages/sdk/js/package.json
#	packages/storybook/package.json
#	packages/ui/package.json
#	packages/util/package.json
#	script/upstream/package.json
#	sdks/vscode/package.json
2026-04-17 12:46:12 +03:00
Johnny Amancio 2e1836a91e Merge remote-tracking branch 'origin/main' into johnnyamancio/kilo-opencode-v1.4.4 2026-04-17 11:42:27 +02:00
Johnny Amancio feea749c51 fix: Resolve test failures for v1.4.4 merge
- Break circular import: Worktree → bootstrap → remote-sender → app-runtime (Not to Kilo not being completely on effect)
- Bump tight test timeouts for Effect-native processing overhead
2026-04-17 11:15:01 +02:00
Christiaan Arnoldus 8c2e586e05 Merge pull request #9069 from Kilo-Org/fix/opus-4.7-adaptive-reasoning
fix(cli): add opus-4.7 adaptive reasoning and xhigh effort
2026-04-17 10:22:00 +02:00
kiloconnect[bot] e60c326319 fix(cli): add opus-4.7 adaptive reasoning and xhigh effort variant 2026-04-17 07:59:52 +00:00
Alex Alecu 04a3db91ec Merge remote-tracking branch 'origin/main' into kilocode-suggest-code-review
# Conflicts:
#	packages/opencode/src/session/prompt.ts
2026-04-17 10:11:41 +03:00
Marian Alexandru Alecu ca6f4bc450 Merge pull request #9039 from Kilo-Org/fix/restore-tsgo-lightweight-diagnostics
fix(cli): restore tsgo lightweight diagnostics
2026-04-17 09:32:56 +03:00
Marian Alexandru Alecu 06cf57dd7c Merge pull request #9038 from Kilo-Org/kilocode-legacy-config
test(cli): restore kilo-config legacy paths test
2026-04-17 09:31:51 +03:00
kiloconnect[bot] 959a8b498d fix(cli): move queued user prompts to end of history
When a user queued a prompt while the previous turn was still streaming,
the message's time_created fell before later assistant steps of that
turn. Ordering by time_created alone left the queued prompt in the
middle of the prior turn's history, so the next request ended with an
assistant message and tripped Anthropic's prefill rejection.

Reorder inside KiloSessionPromptQueue.scope so the target user message
and any of its own turn's assistants are always placed at the end.
2026-04-16 19:35:17 +00:00
Johnny Amancio 689f810705 Merge remote-tracking branch 'origin/main' into johnnyamancio/kilo-opencode-v1.4.4 2026-04-16 20:30:42 +02:00
Marius bea88788f4 fix(cli): continue queued follow-up prompts (#9047)
* fix(cli): continue queued follow-up prompts

* test(cli): stabilize local model persistence test

* fix(cli): preserve queued prompt order

* fix(cli): persist queued prompts before processing

* chore(cli): clarify prompt queue settling

* fix(cli): preserve queued prompt history order

* fix(cli): clear queue state on release and test abort
2026-04-16 18:27:34 +02:00
Christiaan Arnoldus a9c80fb49b Merge branch 'main' into feat/encoding-preservation 2026-04-16 16:32:03 +02:00
Alex Alecu 17e8110e2b chore(cli): remove unused tmpdir import from lightweight LSP test 2026-04-16 16:42:12 +03:00
Alex Alecu d5d8344c7d fix(cli): restore tsgo lightweight TypeScript diagnostics
Re-introduce the lightweight TypeScript diagnostic mode that was lost
during upstream OpenCode merges. Fixes the buggy server.ts spawn (leaked
process, wrong args) and re-adds TsClient integration in index.ts.
2026-04-16 15:00:32 +03:00
Alex Alecu ea507a4544 Merge remote-tracking branch 'origin/main' into kilocode-suggest-code-review
# Conflicts:
#	packages/kilo-vscode/webview-ui/src/components/chat/AssistantMessage.tsx
#	packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx
2026-04-16 14:59:46 +03:00
Alex Alecu 16f48b7641 test(cli): restore kilo-config skill legacy paths test 2026-04-16 14:54:27 +03:00