Skip to content

fix(sidebar): keep agent rows aligned with pane processes - #10066

Open
joowon-jang wants to merge 2 commits into
stablyai:mainfrom
joowon-jang:joowon-jang/investigate-sidebar-agent-icon
Open

joowon-jang wants to merge 2 commits into
stablyai:mainfrom
joowon-jang:joowon-jang/investigate-sidebar-agent-icon

Conversation

@joowon-jang

@joowon-jang joowon-jang commented Jul 23, 2026 •

Copy link
Copy Markdown

Summary

  • derive worktree agent rows from current foreground-process evidence before stale terminal titles
  • require explicit provider-owned title frames so agent names in task text cannot switch the sidebar icon
  • remove non-completed hook rows and their working subagents as soon as the pane is confirmed back at its shell
  • propagate the same evidence to sidebar rows, dashboard snapshots, bucket counts, and dashboard popouts
  • preserve provider-native title formats, split-pane behavior, Windows launcher suffixes, and SSH/remote fallbacks

Fixes #9848.

Root cause

The sidebar combined hook state, terminal titles, and launch metadata without a current per-pane process signal. Generic spinner and task titles could therefore be interpreted as another provider, stale hooks could keep loading and subagent rows alive after process exit, and old titles such as Antigravity could override a running Codex process.

This change makes confirmed shell/process evidence authoritative over stale rows, keeps fresh hook state where it still owns the pane, and restricts title identity to explicit provider-owned frames.

Screenshots

No new UI surface or styling. This corrects the provider icon and loading state in the existing sidebar; before-state screenshots are available in #9848.

Testing

  • pnpm lint — changed-file Oxlint, React Doctor, formatting, and max-lines checks pass; the full command stops on the pre-existing unrelated src/renderer/src/components/skills/skill-freshness-group.tsx:101 switch-exhaustiveness error
  • pnpm typecheck
  • pnpm test — 158 focused regression tests pass locally; an independent Claude review swept 1,002 files / 9,658 relevant tests successfully
  • pnpm build — pnpm run build:desktop passes; the native Swift build is unavailable in this environment because its installed SDK and compiler versions do not match
  • Added or updated high-quality regression tests for cross-provider task-title false positives, process-only rows, split panes, shell cleanup, stale same-provider hooks, stale Antigravity titles, provider-native title frames, and selector identity stability

AI Review Report

An independent Claude reviewer was dispatched through Orca orchestration to inspect every changed and new file plus all consumers of the tightened title resolver and foreground-pane state.

The review checked:

  • hook, process, shell, title, and launch-agent evidence precedence
  • sidebar, dashboard, bucket-count, and popout propagation
  • split-pane and removed-leaf behavior
  • selector cache correctness and hot-path allocation risk
  • macOS, Linux, and Windows behavior, including .exe, .cmd, .bat, and .ps1 launcher titles
  • local, SSH, and WSL boundaries without assuming local process access remotely
  • compatibility across Codex, Claude, Antigravity, Gemini, OpenCode, MiMo, and the other supported agents

The first review found one existing-test regression: mimo working was no longer recognized because the explicit identity aliases omitted the MiMo CLI token. Adding the narrow mimo alias fixed it without accepting path-like, superstring, fixture, or task-text false positives. A follow-up review reported no remaining blockers.

Security Audit

  • no new command execution, shell interpolation, filesystem access, authentication, secrets, dependencies, or IPC surface
  • title parsing is bounded string matching with token-boundary checks
  • foreground evidence is read from the existing pane-process tracker and renderer store
  • invalid or removed pane keys are ignored before row creation
  • no user-controlled value is executed or used as a filesystem path

Notes

  • Foreground process tracking remains local-only. Manually launched remote agents that expose no hook, provider-owned title, or Orca launch metadata still have no reliable identity signal; existing SSH/WSL fallback behavior is preserved.
  • Completed rows remain visible according to the existing retention policy; confirmed shell foreground removes only non-completed stale/loading rows.
  • X: N/A — no X handle is listed on the contributor's GitHub profile.

ELI5

Sidebar agent rows could show the wrong agent or stay stuck after the shell returned. Orca now trusts live process evidence over stale titles, so icons, counts, and dashboard status match what is actually running.

@joowon-jang
joowon-jang marked this pull request as ready for review July 23, 2026 04:13
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds explicit terminal-title identity matching, including aliases, boundary checks, Windows launcher handling, and canonical Braille-frame detection. Sidebar agent-row construction now incorporates pane foreground-agent evidence, filters stale or conflicting rows, and applies updated identity precedence. Foreground-agent entries are indexed and selected per worktree, wired through sidebar hooks, and propagated into dashboard snapshots, bucket counts, and popout refresh comparisons. Tests cover title attribution, selector memoization, row precedence, stale-state handling, and dashboard bucketing.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.17% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main sidebar-agent row alignment change.
Description check ✅ Passed The description includes all required sections and is sufficiently detailed, though a few testing items are still unchecked.
Linked Issues check ✅ Passed The changes address #9848 by prioritizing foreground-process evidence and fixing the wrong sidebar agent icon.
Out of Scope Changes check ✅ Passed The dashboard, popout, and selector updates support the same foreground-evidence propagation and are not out of scope.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/src/components/dashboard/build-dashboard-snapshot.ts (1)

115-118: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Avoid rebuilding the foreground-agent index once per worktree.

selectPaneForegroundAgentEntriesForWorktree rebuilds the complete worktree index on every call. Since this call is inside the worktree loop, snapshot construction reindexes all panes once per worktree. Add an all-worktrees selector/cache and read the current worktree’s entry from it once per snapshot.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6055445b-99dd-4fe7-b660-79948a9b3555

📥 Commits

Reviewing files that changed from the base of the PR and between bae29fd and 8a1555b.

📒 Files selected for processing (17)
  • src/renderer/src/components/dashboard/build-dashboard-snapshot.test.ts
  • src/renderer/src/components/dashboard/build-dashboard-snapshot.ts
  • src/renderer/src/components/dashboard/useAgentBucketCounts.ts
  • src/renderer/src/components/dashboard/useDashboardPopoutBridge.test.tsx
  • src/renderer/src/components/dashboard/useDashboardPopoutBridge.ts
  • src/renderer/src/components/sidebar/useWorktreeAgentRows.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-evidence-precedence.test.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-selectors.test.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-selectors.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-type.ts
  • src/renderer/src/components/sidebar/worktree-agent-rows.ts
  • src/renderer/src/components/sidebar/worktree-pane-foreground-index.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.test.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
  • src/shared/explicit-agent-title-identity.ts
  • src/shared/terminal-title-agent-type.test.ts
  • src/shared/terminal-title-agent-type.ts

…te-sidebar-agent-icon

# Conflicts:
#	src/renderer/src/components/dashboard/build-dashboard-snapshot.ts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: wrong agent icon displayed in sidebar

3 participants