Commit Graph
19417 Commits
Author SHA1 Message Date
Marius 5fcc4231c0 Fix Agent Manager session selector state (#9922)
* tmp

* fix(agent-manager): recover session preferences from history

* fix(agent-manager): use scoped prompt selections

* Delete packages/kilo-vscode/docs/agent-manager-session-preferences.md
2026-05-06 15:46:43 +00:00
Marius e5e9d0ba37 Delete custom providers from config (#9921)
* fix: delete custom providers from config

* fix: clear project custom provider config
2026-05-06 17:12:23 +02:00
Imanol Maiztegui 9c581d3992 Unified diff view for session changes and workspace changes (#9897)
* feat(vscode): add foundational types and abstractions for unified diff panel

Introduce the core type definitions and abstractions that support the
upcoming session diff viewer:

- PanelSurface: testable abstraction over vscode.WebviewPanel
- DiffSource/DiffSourceDescriptor: contracts for swappable diff providers
- DiffSourceCatalog: stub registry for enumerating and constructing sources
- PanelContext/DiffFile: cross-cutting types shared by manager and webview

* feat(diff): implement worktree diff source with polling and file revert

Add WorktreeDiffSource, a DiffSource implementation that computes diffs
between the local working tree and the base branch. Key behaviors:

- Resolves the diff target from the workspace root via GitOps
- Performs an initial fetch then polls every 2.5s with hash-based dedup
- Supports single-file revert through WorktreeDiffClient
- Posts structured messages (loading, diffs) to the panel via DiffSourcePost

* add(vscode): session diff source and unified patch parser

Introduce two new modules under the diff sources layer:

- patch-to-before-after.ts: reconstructs before/after file content
  from full-context unified diff patches by filtering line prefixes
- session.ts: SessionDiffSource fetches accumulated diffs for a given
  session, converts patches to before/after pairs, and posts results
  to the diff panel without polling or SSE

* feat(diff): wire up diff source catalog with session and worktree builders

Replace stub implementations in DiffSourceCatalog with real logic:

- Inject KiloConnectionService and use it to fetch session diffs
- Populate listAvailable based on PanelContext (workspace root, session)
- Route build() to WorktreeDiffSource or SessionDiffSource by id prefix
- Extract sessionDescriptor() and SESSION_PREFIX from SessionDiffSource
  to decouple descriptor creation from class instantiation
- Export WORKSPACE_DESCRIPTOR from worktree module for catalog reuse

* refactor(vscode): introduce DiffPanelManager and centralize diff panel lifecycle

Extract panel ownership out of DiffViewerProvider into a new
DiffPanelManager class that manages a single global "Changes" webview.
Key changes:

- Add DiffPanelManager with source-swapping, loading pulse, webview
  serialization, and disposable lifecycle management
- Add testable Scheduler abstraction to decouple setTimeout usage
- Extend DiffSourceCatalog with defaultSourceId() resolution logic
  and replace magic "workspace" string with WORKSPACE_SOURCE_ID const
- Extract sessionSourceId() helper in session source module
- Thread sessionId through openChanges command and sidebar context so
  the panel can open directly to the relevant session diff
- Re-register webview panel serializer under DiffPanelManager.viewType

* feat(diff): add source descriptor and capability message types for webview

Introduce new extension-to-webview and webview-to-extension message
interfaces to support multi-source diff panel switching:

- DiffSourceCapabilities, DiffSourceDescriptor for describing available
  diff sources with revert/comments flags and grouping metadata
- SetAvailableSourcesMessage and DiffViewerCapabilitiesMessage for
  pushing source lists and active capabilities to the webview
- SelectSourceRequest for the webview to request a source switch

* refactor(webview): integrate diff source picker into viewer and relocate shared types

Move DiffSourceCapabilities and DiffSourceDescriptor interfaces out of
extension-messages.ts into the shared diff/sources/types module, and
re-export them via import. Add DiffPickerHeader component with a
grouped Select dropdown for switching between multiple diff sources.
Wire source selection state and capability tracking into DiffViewerApp,
handling setAvailableSources and diffViewer.capabilities messages and
conditionally rendering the picker header above the diff view.

* feat(diff-viewer): add canRevert and canComment capability flags to full-screen diff

Introduce two optional boolean props (`canRevert`, `canComment`) on
FullScreenDiffView that allow callers to disable revert actions and
comment creation based on the active diff source's capabilities.

Guard gutter click handlers, keyboard shortcuts, the "Send all" button,
revert buttons, and sidebar revert callbacks behind these flags. In
DiffViewerApp, forward the capability values from the selected source
and reset transient UI state (comments, diff style, reverting set) on
source switches via a reactive effect.

* test(vscode): add unit tests for diff panel manager, source catalog, and patch utilities

Cover DiffPanelManager lifecycle (open, reveal, dispose, deserialized
panel disposal, source switching, comment forwarding), DiffSourceCatalog
listing/defaulting/building logic, SessionDiffSource fetch-and-convert
flow, and patchToBeforeAfter edge cases.

Also refactor DiffPanelManager to decouple panel creation from surface
adoption: the createSurface factory no longer receives a panel argument,
panel construction moves into a private defaultCreateSurface method, and
deserializePanel now disposes stale panels instead of rewiring them.
Extend the vscode mock with a createOutputChannel stub to support the
new test harness.

* refactor(diff): extract command-context assembly into DiffPanelManager.openFromCommand

Move PanelContext construction (workspace root resolution, session ID
lookup, initial source selection) out of the extension command handler
and into a dedicated openFromCommand method on DiffPanelManager. This
eliminates the extension's direct dependency on getWorkspaceRoot and
provider.getCurrentSessionId by accepting a sessionIdProvider callback
through DiffPanelManagerOptions.

Update tests to cover both provider-based and arg-based session ID
resolution paths in openFromCommand.

* feat(vscode): unify changes panel with multi-source diff architecture

Delete the legacy DiffViewerProvider in favor of the new
DiffPanelManager-based architecture. Decompose review-utils into
focused modules under diff/shared/ (client, hash, target) and update
all consumers to import from the new locations.

- Remove DiffViewerProvider and its registration in extension.ts
- Extract WorktreeDiffClient, DiffTarget into diff/shared/client
- Extract hashFileDiffs into diff/shared/hash
- Extract resolveLocalDiffTarget into diff/shared/target
- Slim down review-utils to only VS Code UI helpers
- Add changeset for the unified Changes panel feature

BREAKING CHANGE: DiffViewerProvider is removed; all diff viewing now routes through DiffPanelManager

* refactor(diff): add polling with hash dedup to SessionDiffSource

Upgrade SessionDiffSource from one-shot fetch to periodic polling
(2.5s interval) with hash-based deduplication, matching the pattern
already used by WorktreeDiffSource. Also clean up legacy references
in WorktreeDiffSource doc comments.

- Introduce POLL_INTERVAL_MS constant and start/stop polling lifecycle
- Track lastHash to skip redundant diff posts when content unchanged
- Extract fetchDiffs helper to share between initialFetch and poll
- Guard all post calls against disposed state
- Add comprehensive polling unit tests with scripted fetch helper

* fix(ui): rename worktreeStats() calls to session.summary() in ChatView

Update ChatView component to use the renamed `session.summary()`
accessor instead of the deprecated `session.worktreeStats()` method,
aligning with the unified multi-source diff architecture.

* feat(diff): add snapshots-disabled notice to session diff source

Introduce a `notice` message type in the diff source protocol so that
`SessionDiffSource` can warn users when snapshot tracking is turned off
for their repository. The check queries the workspace config before
fetching diffs; when disabled, polling is skipped entirely and a
warning banner is rendered in the diff viewer webview.

- Add `SnapshotEnabledCheck` callback wired through `DiffSourceCatalog`
- Extend `DiffSourceMessage` and `ExtensionMessage` with `notice` type
- Forward notice messages from `DiffPanelManager` to the webview
- Render warning banner with icon in `DiffViewerApp`
- Add CSS for `.diff-viewer-notice` component
- Cover new behavior with unit tests

* refactor(i18n): replace hardcoded notice strings with typed keys and localized messages

Convert the diff viewer notice system from passing raw English strings
through the message protocol to using well-known typed identifiers that
the webview resolves to translated text at render time.

- Define `DiffSourceNotice` union type in source protocol layer
- Define `DiffViewerNotice` union type in webview message contract
- Change `notice` field from `message: string` to `notice: T | undefined`
- Map notice identifiers to i18n keys in `DiffViewerApp` via lookup table
- Localize `DiffPickerHeader` labels and group names through `useLanguage`
- Add `diffViewer.*` translation keys across all 19 locale files
- Update unit tests to assert typed notice identifiers

* docs(changeset): update unified diff panel description

Clarify feature summary to mention sidebar badge counts and
snapshots-disabled warning alongside the source dropdown.

* feat(vscode): port markdown diff render ahead of main merge

Cherry-picks the user-facing bits of main's #9846 (render markdown diffs) into
this branch so merging main later is trivial for the 5 shared files. Wires the
markdown toggle through the new DiffPanelManager architecture as global state,
persisted via the kilo-code.new.diff.renderMarkdown setting.

* refactor(vscode): replace if-chain message dispatch with handler map

Extract DiffPanelManager.onMessage logic into a declarative
messageHandlers record and a dedicated onWebviewReady method.
Also fix import paths for DiffSourceDescriptor/DiffSourceCapabilities
to reference canonical source types, add explicit generic to Set<string>,
and extend webview tsconfig include to cover diff-viewer and diff-virtual.

* style(ui): add padding to select section headers

* fix: formatting

* fix(vscode): prevent stale source activation after panel teardown

Introduce an epoch counter to guard against race conditions where
activateSource completes its async initialFetch after the panel has
been disposed or the source has been swapped. The epoch is incremented
on every source teardown and checked before starting polling.

* refactor(vscode): scope source post guard to lifecycle epoch

Pass the epoch counter into createSourcePost so that messages emitted
by a source after its lifecycle has ended are silently dropped. This
closes a gap where polling callbacks could still push updates to the
surface after the source was swapped out.

* feat(diff-viewer): rename workspace source to "Local Changes" and add tooltip

Remove the "Workspace" source group, moving the worktree source under
"Git". Rename its label from "Workspace local" to "Local Changes" across
all locales and introduce a tooltip explaining that it covers all branch
changes vs the base (uncommitted files and local commits). The picker
header now renders option tooltips on hover with a delayed open.

* docs(i18n): translate workspace tooltip into all supported locales

Replace the English fallback string for
`diffViewer.source.workspace.tooltip` with native translations in ar,
bs, ja, ko, no, pl, ru, th, tr, uk, zh, and zht locale files.

* style(diff-viewer): rename parameter `d` to `desc` in DiffPickerHeader

Improve readability by expanding the terse single-letter parameter name
to a more descriptive `desc` across helper functions and the render
callback in DiffPickerHeader.

* refactor(diff-sources): replace hardcoded label with type-driven i18n key lookup

Replace the `label` string field in DiffSourceDescriptor with a
`DiffSourceType` discriminant (`"workspace" | "session"`). The webview
now composes i18n keys dynamically from the type, eliminating ad-hoc
id-matching logic in DiffPickerHeader and ensuring every source gets
both a label and a tooltip via the translation dictionaries.

Also adds `diffViewer.source.session.tooltip` translations for all
supported locales and introduces descriptor-type stability tests.

* fix(i18n): shorten session source label by removing "current" qualifier across all locales

* refactor(diff): extract shared polling interval constant into dedicated module

Consolidate the duplicated `POLL_INTERVAL_MS` definitions from
`session.ts`, `worktree.ts`, and the hardcoded literal in
`worktree-diff-controller.ts` into a single `DIFF_POLL_INTERVAL_MS`
export in `diff/polling.ts`. Update all consumers and tests to
reference the new canonical constant.

* feat(diff): replace DiffPanelManager with DiffViewerProvider and SourceController

Remove the `manager/` directory (DiffPanelManager, panel-surface,
scheduler) and introduce two focused replacements:

- `DiffViewerProvider`: owns the webview panel lifecycle, HTML rendering,
  and message routing directly against `vscode.WebviewPanel`
- `SourceController`: manages the active DiffSource with epoch-based
  stale-message filtering, decoupled from any webview abstraction

The PanelSurface and Scheduler indirection layers are eliminated in
favor of direct VS Code API usage in the provider and a simpler
epoch-guarded post function in the controller. Tests are rewritten
to exercise SourceController in isolation without fake surfaces.

BREAKING CHANGE: DiffPanelManager, PanelSurface, and Scheduler exports are removed

* refactor(diff): decouple SourceController from DiffSourceCatalog via dependency injection

Replace the direct DiffSourceCatalog dependency in SourceController with
two injected function callbacks (`build` and `listAvailable`), removing
the tight coupling to the catalog class. DiffViewerProvider now passes
thin wrappers that delegate to the catalog instance.

Update tests to use lightweight inline fakes instead of the FakeCatalog
subclass, and remove redundant polling/lifecycle tests that tested
implementation details rather than behavior.

* feat(diff): add lazy per-file content loading for worktree diffs

Introduce on-demand fetching of full file content (before/after) for
summarized diff entries. The worktree source now polls only a lightweight
summary and resolves detail via `requestFile` when the webview expands a
file.

- Add `requestFile` to `DiffSource` interface and implement in
  `WorktreeDiffSource` using local git operations
- Wire `diffViewer.requestFile` message through DiffViewerProvider to
  SourceController
- Add `diffViewer.diffFile` extension message to deliver single-file
  detail back to the webview
- Webview merges incoming summaries with cached detail, tracks
  per-file loading state, and auto-refreshes stale entries

* refactor(session): replace custom patch parser with shared kilo-ui session-diff utilities

Remove the hand-rolled `patchToBeforeAfter` function and its unit tests
in favor of the `normalize` and `text` helpers exported from
`@kilocode/kilo-ui/session-diff`. This eliminates duplicated parsing
logic and aligns the extension with the canonical diff reconstruction
used across the UI layer.

* test(diff): add hash utility tests and remove obsolete polling specs

Introduce a dedicated test suite for `hashFileDiffs` covering stability,
field sensitivity, and summarized-patch exclusion semantics. Remove the
now-unused polling tests and their helper functions (`scripted`, `wait`,
`modifiedPatchV2`) from the session source spec, reducing test surface
to match the current implementation boundaries.

* style(webview): add spacing for diff picker header component

* fix(diff): prefer workspace over session as default diff source

Change priority order in defaultSourceId so workspace source takes
precedence over session source when both workspaceRoot and sessionId
are present. Update ChatView to use renamed worktreeStats() accessor.

* fix(vscode): correct DiffViewerProvider path, bump max-lines cap, and apply font-size token

Update font-size arch test to reflect DiffViewerProvider's move into
src/diff/, raise KiloProvider max-lines eslint cap to 3500, and
replace hardcoded 12px in banners.css with --kilo-font-size-12.
2026-05-06 16:54:53 +02:00
Marian Alexandru Alecu 3c73e90e4a Merge pull request #9453 from truffle-dev/fix/vscode-forward-http-proxy-to-cli
fix(vscode): forward VS Code http.proxy settings to spawned CLI process
2026-05-06 17:19:23 +03:00
Kirill Kalishev d5da176472 Merge pull request #9937 from Kilo-Org/recondite-crane
fix(jetbrains): auto-scroll
2026-05-06 09:50:40 -04:00
Alex Alecu 8cde26d7be fix(vscode): clear lowercase proxy 2026-05-06 16:41:57 +03:00
Alex Alecu 417401703c fix(vscode): clear proxy env 2026-05-06 16:19:06 +03:00
Marian Alexandru Alecu 4cc65f2ce4 Merge pull request #9765 from truffle-dev/fix/plan-mode-mkdir-recursive-onedrive-9755
fix(cli): tolerate pre-existing plan directory on OneDrive
2026-05-06 15:42:25 +03:00
Marian Alexandru Alecu b1da38e9ac Merge branch 'main' into fix/plan-mode-mkdir-recursive-onedrive-9755 2026-05-06 14:50:22 +03:00
Marian Alexandru Alecu f4f5a001ce Merge pull request #9915 from Kilo-Org/fix/compact-thinking-level
fix(cli): preserve variant on compact
2026-05-06 14:38:20 +03:00
Christiaan Arnoldus 780695b0bf Merge pull request #9958 from Kilo-Org/chrarnoldus-patch-1
Remove Kilo-specific claude code header
2026-05-06 13:18:21 +02:00
Marius aec2425f6e Update native tab titles from sessions (#9961)
* feat(vscode): update native tab titles from sessions

* test(vscode): cover native tab title formatting
2026-05-06 11:15:22 +00:00
Alex Alecu b537c6191f chore(review): merge main 2026-05-06 14:05:01 +03:00
Christiaan Arnoldus fb3438556e Remove Kilo-specific claude code header
Can't imagine this makes sense
2026-05-06 12:21:32 +02:00
Marian Alexandru Alecu e4d0787cc0 Merge pull request #9187 from sylwester-liljegren/install-script-update
feat(install): add Windows PATH persistence via registry
2026-05-06 13:17:24 +03:00
Mark IJbema bb1f2e48fe Merge pull request #9952 from Kilo-Org/mark/upstream-merge-head-base
Support HEAD as upstream merge base
2026-05-06 12:02:08 +02:00
Mark IJbema ca36a75c2d Merge branch 'main' into mark/upstream-merge-head-base 2026-05-06 11:52:23 +02:00
Mark IJbema 3bd1f28341 Merge pull request #9891 from Kilo-Org/session/agent_a6ecf426-6df9-4de2-832c-c3835090b68b
fix(cli): isolate upstream rerere training
2026-05-06 11:52:09 +02:00
kiloconnect[bot] e88dd31421 feat: support HEAD as upstream merge base 2026-05-06 09:38:26 +00:00
Mark IJbema c4a9ab912f Merge branch 'main' into session/agent_a6ecf426-6df9-4de2-832c-c3835090b68b 2026-05-06 11:22:24 +02:00
Alex Alecu 2d19ec2ff0 fix(ci): run workflow guard 2026-05-06 12:20:57 +03:00
Mark IJbema 82fc494cdd Merge pull request #9911 from Kilo-Org/markijbema/kilo-opencode-v1.14.30
Merge opencode v1.14.30
2026-05-06 11:20:42 +02:00
Marian Alexandru Alecu a283dc1822 Merge branch 'main' into install-script-update 2026-05-06 12:14:58 +03:00
kilo-maintainer[bot] b1349843c8 release: v7.2.42 v7.2.42 2026-05-06 09:05:30 +00:00
Mark IJbema 30d8a92197 Merge pull request #9949 from Kilo-Org/fix/checkout-v6-committer-token
fix(ci): clear checkout v6 credentials
2026-05-06 10:48:13 +02:00
kiloconnect[bot] fb5594743b fix(ci): clear checkout v6 credentials 2026-05-06 08:38:59 +00:00
Marius 8ed0e17855 fix(agent-manager): recover worktrees after restart (#9939) 2026-05-06 10:25:55 +02:00
Mark IJbema ef45bedc33 Merge branch 'main' into session/agent_a6ecf426-6df9-4de2-832c-c3835090b68b 2026-05-06 10:25:08 +02:00
Christiaan Arnoldus 5a90684ea2 Merge pull request #9918 from Kilo-Org/fix/encoding-flat-exports
refactor(cli): flatten Encoding/EncodedIO namespaces to module exports
2026-05-06 10:23:27 +02:00
Alex Alecu c776693f3b fix(ci): restore workflow check 2026-05-06 11:16:58 +03:00
Alex Alecu bd6bbdddf3 style(cli): use marker block 2026-05-06 11:01:50 +03:00
Imanol Maiztegui cd760cf3ca Merge pull request #9946 from Kilo-Org/imanol/edit-tool-styling
fix(vscode): theme edit tool diff in chat
2026-05-06 09:49:55 +02:00
Mark IJbema f3efadfe62 Merge branch 'main' into markijbema/kilo-opencode-v1.14.30 2026-05-06 09:48:59 +02:00
Mark IJbema 045a9b3291 fix versions 2026-05-06 09:34:48 +02:00
Imanol Maiztegui bff44337c7 refactor(styles): move Pierre diff CSS variables to vscode-bridge theme layer
Remove the `.kilo-diff-theme` utility class and its dedicated stylesheet,
relocating all Pierre diff engine custom properties into the centralized
`vscode-bridge.css` theme definition. This allows diff components to
inherit theming from the document root without requiring an explicit
class annotation on each container element.

- Delete `webview-ui/src/styles/diff.css`
- Drop `kilo-diff-theme` class from DiffPanel, FullScreenDiffView,
  DiffVirtualApp, and PermissionDiff components
- Remove corresponding `@import` statements from chat.css and
  agent-manager.css
2026-05-06 09:31:25 +02:00
Mark IJbema 68b2725f22 Merge pull request #9942 from Kilo-Org/mark/check-workflow-allowlist
ci: guard against upstream workflow additions
2026-05-06 09:27:07 +02:00
Mark IJbema aa59e70660 test(cli): fix TUI sync provider setup 2026-05-06 09:22:21 +02:00
kiloconnect[bot] 37af1bc751 check-workflows: drop disabled list, only check runnable workflows 2026-05-06 07:11:04 +00:00
kilo-maintainer[bot] 71d091b6bc chore: update nix node_modules hashes 2026-05-06 07:09:04 +00:00
kiloconnect[bot] 1a3a53f881 Merge remote-tracking branch 'origin/main' into fix/encoding-flat-exports
# Conflicts:
#	packages/opencode/src/kilocode/encoding.ts
2026-05-06 07:01:29 +00:00
Christiaan Arnoldus d0d5296e6d Merge pull request #9920 from Kilo-Org/simplify-bom-detection
refactor(cli): dedupe BOM byte sequences in encoding module
2026-05-06 08:58:12 +02:00
Christiaan Arnoldus 3f968d00b7 Merge pull request #9923 from Kilo-Org/chore/replace-jschardet-with-chardet
chore(cli): replace jschardet with chardet
2026-05-06 08:57:16 +02:00
Mark IJbema 1fcd9a6a40 Merge branch 'main' into markijbema/kilo-opencode-v1.14.30 2026-05-06 08:53:54 +02:00
kiloconnect[bot] 0c21808597 fix(check-workflows): also catch .yaml files 2026-05-06 06:48:06 +00:00
Mark IJbema 8d63212fb9 Merge pull request #9908 from Kilo-Org/catrielmuller/test-stability
test(cli): stabilize flaky unit test CI
2026-05-06 08:45:37 +02:00
kiloconnect[bot] ed973a93c0 annotate kilocode_change markers 2026-05-06 06:40:25 +00:00
kiloconnect[bot] 34959bfaac ci: guard against upstream workflow additions
Hardcodes the list of active and disabled workflows and fails CI when
.github/workflows/ drifts. Wired into check-opencode-annotations so we
don't add a new workflow file for this.
2026-05-06 06:38:28 +00:00
kirillk 7f5f7e30c9 perf(jetbrains): reduce session scroll layout work 2026-05-05 17:55:35 -04:00
Thomas BrugmanandMarius 40a4d5eae2 fix(ui): keep settings select within viewport (#9910)
Co-authored-by: Marius <marius@kilocode.ai>
2026-05-05 21:43:48 +00:00
kirillk ceef678ecb fix(jetbrains): stabilize existing session scroll 2026-05-05 17:13:30 -04:00