* Poll local workspace git stats in Agent Manager
Extend the stats polling mechanism (renamed from WorktreeStatsPoller to
GitStatsPoller) to also poll the local workspace's branch name, diff
stats, and unpushed commits on the same 5s interval used for worktrees.
Previously the local branch name was only fetched on-demand when the
user clicked the Local sidebar item or when the panel first opened,
and no diff stats were shown for local at all.
Changes:
- GitStatsPoller now accepts getWorkspaceRoot and onLocalStats callbacks
- Each poll cycle fetches local branch, resolves tracking branch, and
computes additions/deletions/commits against remote
- New agentManager.localStats message type pushes data to the webview
- Local sidebar item displays diff stats badges (+N / -N / ↑N)
- Diff toggle button shows change indicator when local has changes
- Poller always enabled (not gated on worktree count)
* Fix review issues: gate polling on worktrees/panel, preserve stats on failure
- Only enable GitStatsPoller when worktrees exist or the panel is open,
avoiding unnecessary background git fetch for users without worktrees
- On transient HTTP client or diff fetch failure, skip emitting instead
of zeroing stats, preserving last-known values in the UI
* Refactor poller and fix the edge case that users cannot access origin
* Remove unrelated changes
* Extract GitOps from GitStatsPoller, fix PR review comments
- Extract git operations into GitOps class backed by simple-git
- GitStatsPoller now requires GitOps injection (no internal creation)
- AgentManagerProvider creates shared GitOps, passes to poller and WorktreeManager
- Remove duplicate getRemoteTrackingBranch/git methods from AgentManagerProvider
- WorktreeManager delegates currentBranch/defaultBranch to GitOps when available
- Fix: preserve last-known local stats on HTTP client failure
- Fix: fall back to origin/HEAD for branches with no upstream
- Fix: preserve throw behavior in WorktreeManager.currentBranch delegation
- Add GitOps unit tests (17 tests) and update poller tests
* Handle remaining edge cases
* Fix branch stripping
Track panel visibility from panel/terminal commands so switching sessions no longer force-opens a hidden terminal, while preserving automatic terminal switching when the panel is already visible.
* fix(agent-manager): filter sessions by project ID to prevent cross-repo leaks
* fix: address PR review - reset projectID from all fetches, remove kilocode_change markers
* fix: move project filter before trackedSessionIds guard, extract into tested function
The projectID filter was placed AFTER the trackedSessionIds guard,
making it unreachable — session.created events for untracked sessions
were already blocked before the projectID check could run. Moved the
filter to the top of handleSSEEvent so it runs first.
Extracted isEventFromForeignProject into sse-utils.ts as a pure
function with unit tests covering all event types and edge cases.
Move loose root-level components into feature folders and extract
cross-feature reusable components into a shared/ layer:
- components/profile/ — ProfileView + DeviceAuthCard (was at root)
- components/settings/Settings.tsx — moved from root into settings/
- components/shared/ — ModelSelector, ModeSwitcher, ThinkingSelector,
WorkingIndicator, model-selector-utils (extracted from chat/)
Fixes the cross-folder coupling where settings/ProvidersTab and
agent-manager/ imported from chat/ for reusable selector components.
Update all import paths in App.tsx, PromptInput, MessageList,
ProvidersTab, AgentManagerApp, MultiModelSelector, and settings/index.ts.
GitHub URLs cause persistent HTTP/2 protocol errors when checked
from GitHub Actions runners, failing the CI with 27 false-positive
broken link errors. These are first-party URLs we control and are
not actually broken.
* Fix file view collapse regressions
* Fix agent manager diff viewer collapse and scroll reset bugs
Reset openInit flag when switching sessions via a new sessionKey prop so
diff files auto-expand for each session instead of staying collapsed.
Stabilize diff data references during 2.5s polling to prevent <For> from
tearing down and rebuilding <Diff> components, which destroyed scroll
position. Guard setOpen in the auto-open effect to skip updates when the
file list is unchanged.
* remove package.json
Replace the separate ghost text overlay div with an inline span inside
the existing highlight overlay. Remove the dedicated `ghostRef`,
scroll-sync logic, and associated CSS classes (`prompt-input-ghost-overlay`,
`prompt-input-ghost-hidden`). Adjust padding on the highlight overlay and
textarea to accommodate the ghost text span in the same layout flow.
Move ghost text into a separate absolutely-positioned overlay div that
mirrors the textarea's scroll position, replacing the previous inline
span approach. Add a hidden span to offset the visible ghost text to
the correct position after the current input, ensuring the ghost text
stays aligned with the caret regardless of scroll state.
* detect and remove externally deleted worktrees from agent manager state via polling
* handle rejection in worktree validation polling
* prevent overlapping validation runs and redundant persistence writes
* guard polling startup on panel liveness and fix flush() to drain queued saves
* fix potential infinite loop in flush() when pendingSave is true without active save
* fix: agent manager terminal follows context when switching to local mode
When switching from a worktree to local mode with a pending tab,
currentSessionID() was undefined causing terminal triggers (Cmd+/ and
button click) to silently do nothing. Added a showLocalTerminal fallback
that opens a terminal at workspace root, and showExistingLocalTerminal
to auto-reveal the local terminal when switching contexts.
* fix: show warning when local terminal has no workspace folder
* refactor: centralize local terminal key in SessionTerminalManager