Skip to content

Sidebar shows worker session name twice (title line == id line) when worker has no displayName/issueId #282

@AgentWrapper

Description

@AgentWrapper

Bug

In the project sidebar, a worker session row renders the session name on both lines — the primary title and the mono subtitle show the identical string (e.g. reverbcode-2 over reverbcode-2). The subtitle is meant to be a secondary handle distinct from the title, so the duplication looks broken.

sidebar duplicate label

Source: reported in chat (local Electron app) | Reported by: @Itrytoohard | Analyzed against: 6ac65d2 (origin/main)
Confidence: High — exact code path traced below.
Priority: low — cosmetic; no functional impact, but reads as a rendering bug.

Reproduction

  1. Spawn a plain worker session that has no issue association and is never renamed, e.g. ao spawn --project reverbcode (reproduced live against the daemon on :3001 with session reverbcode-2).
  2. Open the Electron app sidebar and expand the project.
  3. The worker row shows its id as the title and repeats the same id as the mono subtitle.

Live confirmation: /tmp/ao session get reverbcode-2 returns no display name; the session id is reverbcode-2, which is exactly what appears on both lines.

Root Cause

Two layers combine:

  1. Title falls back to id. frontend/src/renderer/hooks/useWorkspaceQuery.ts:54 (origin/main) maps:

    title: session.displayName ?? session.issueId ?? session.id,

    For a worker with neither displayName (set only via the rename endpoint — backend/internal/httpd/controllers/sessions.go:185) nor issueId (set only on issue-driven spawns), title resolves to session.id.

  2. Sidebar renders title and id as two separate lines, unconditionally. frontend/src/renderer/components/Sidebar.tsx:499 renders {session.title} and Sidebar.tsx:501 renders {session.id} directly beneath it. When title === id, the same string prints twice.

Both displayName and issueId are optional in the API schema (frontend/src/api/schema.ts Session: displayName?: string, issueId?: string), so this is the default state for any plainly-spawned, un-renamed worker — not an edge case.

Fix

Suppress the redundant subtitle when it adds no information — only render the id line when it differs from the title, in frontend/src/renderer/components/Sidebar.tsx:

{session.title !== session.id && (
  <span className="block truncate font-mono text-[10px] text-passive">{session.id}</span>
)}

This keeps the id as a stable secondary handle when the worker has a real display name / issue id, and collapses to a single clean line otherwise. (Alternative: give the subtitle a distinct meaning — e.g. branch or provider — but that is a larger design call; the conditional is the minimal correct fix.)

Impact

  • Every un-renamed, non-issue worker session in the sidebar shows a duplicated label.
  • Purely visual; navigation, status dot, and selection are unaffected.

Related

  • #239 — separate frontend/sidebar-area rendering bug (daemon status dot), same component tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontendElectron frontend lanepriority: lowNice to have, no rush

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions