Skip to content

fix(sidebar): keep repos with only finished agents out of "With agents"#709

Merged
svenmalvik merged 1 commit into
mainfrom
issue/708-agentless-repos-with-agents
Jun 13, 2026
Merged

fix(sidebar): keep repos with only finished agents out of "With agents"#709
svenmalvik merged 1 commit into
mainfrom
issue/708-agentless-repos-with-agents

Conversation

@svenmalvik

Copy link
Copy Markdown
Collaborator

Summary

When all of a repo's agents finished, the repo stayed listed under With agents instead of dropping back to Repositories, and its only affordance — the active card's × — removed the repo entirely. So the one available "cleanup" action behaved like destructive removal (the user had to re-add the repo).

Root cause: section membership in ProjectList.tsx counted every standalone session via filterStandaloneProjectSessions(...).length > 0, including terminal (done/error) ones. The collapsed mini-dots already hide terminal agents (status !== 'done' && status !== 'error'), so a finished-agent repo appeared in With agents with no dots — looking agentless while still being grouped there.

Fix: compute the three section-membership values (withAgentsProjects, inactiveProjects, activeHasAgents) from active agents only, via a new filterActiveStandaloneProjectSessions helper that mirrors the mini-dot predicate. A repo with only finished agents now falls into Repositories (or pins above the sections when it is the active repo), so the destructive × only applies to a genuinely agentless repo where removal is the intended action. The active card still renders its terminal agents (rendering uses filterStandaloneProjectSessions, unchanged), so finished agents stay visible/deletable.

Scope note: deleting an agent already removed its session, so that path was never the bug; this only changes how terminal-but-not-deleted sessions are grouped. useAutoSelectActiveProject (a separate feature) intentionally keeps the all-sessions filter.

Testing

  • npm test -- src/renderer/session-selection.test.ts src/renderer/components/sidebar/ProjectSidebar.test.tsx47 passed (2 new sidebar reproduction tests + 3 new helper unit tests; both reproductions fail on main, pass with the fix).
  • npm test (full suite) → 2214 tests passed. The 4 failing suites are the known local worktree artifact (Denied ID … pdf.worker.min.mjs?url from symlinked node_modules; green on CI) and are unrelated to this change.
  • npm run typecheck:web → clean.

Verification is via component tests that render the real ProjectSidebarProjectList tree with done/error sessions, exercising the exact membership code path. Live-app before/after screenshots were not captured because driving a runtime to a terminal (done) state deterministically is impractical in the autonomous run; the deterministic component tests cover the same path.

Fixes #708

The repo-list sections counted every standalone session toward "With
agents" membership, including terminal (done/error) ones. A repo whose
agents had all finished therefore lingered in "With agents" looking
agentless, and its only affordance was the active card's destructive
repo-remove "x" — making cleanup behave like full removal (#708).

Compute section membership from active agents only via a new
filterActiveStandaloneProjectSessions helper, mirroring the predicate the
collapsed mini-dots already use (status not in {done, error}). Repos with
only finished agents now fall back to "Repositories" (or pin above the
sections when active), so the destructive "x" only applies to a genuinely
agentless repo where removal is the intended action.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@svenmalvik svenmalvik requested a review from a team June 13, 2026 13:37
@svenmalvik svenmalvik merged commit 743e17b into main Jun 13, 2026
@svenmalvik svenmalvik deleted the issue/708-agentless-repos-with-agents branch June 13, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agentless repos stay in 'With agents' and x removes them entirely

1 participant