Skip to content

Show green check when agent finished editing worktree#407

Merged
NagyVikt merged 2 commits intomainfrom
agent/claude/finished-icon-on-active-agents-tree
Apr 23, 2026
Merged

Show green check when agent finished editing worktree#407
NagyVikt merged 2 commits intomainfrom
agent/claude/finished-icon-on-active-agents-tree

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Summary

  • deriveSessionActivity in session-schema.js now returns a new finished kind when the worktree is dirty but no file activity has happened for IDLE_ACTIVITY_WINDOW_MS (2 min). working stays reserved for fresh file changes.
  • extension.js wires finished through SESSION_ACTIVITY_GROUPS, SESSION_ACTIVITY_ICON_IDS (pass-filled + testing.iconPassed green), iconColorId, countWorkingSessions, buildWorkingNowNodes, buildIdleThinkingNodes, workingSessionSortKey, sessionStatusLabel ("Finished") and sessionFreshnessLabel ("Finished").
  • dead already renders with the red error icon for crashed / usage-limited agents, so the X-on-error ask is already covered by the existing state; this PR doesn't widen that signal.

Files

  • vscode/guardex-active-agents/extension.js
  • vscode/guardex-active-agents/session-schema.js
  • templates/vscode/guardex-active-agents/extension.js
  • templates/vscode/guardex-active-agents/session-schema.js (kept byte-identical to the non-template copy)

Test plan

  • node -c on all four JS files.
  • Restart VS Code extension host and verify: a worktree with unchanged files for >2 min shows a green check in "Working now" while an actively-edited worktree keeps the spinner; a crashed agent keeps the red X (dead).

🤖 Generated with Claude Code

NagyVikt and others added 2 commits April 23, 2026 22:32
Until now every agent with a dirty worktree appeared in "Working now"
with the spinner icon, even when the CLI had stopped touching files
minutes ago and was effectively idle waiting for a review / commit.
That made it impossible to tell from the tree which worktrees were
still making progress and which were done but uncommitted.

`deriveSessionActivity` now distinguishes `working` (worktree dirty +
fresh file activity) from the new `finished` kind (worktree dirty +
no file activity for `IDLE_ACTIVITY_WINDOW_MS`). The `finished` kind
is listed in `SESSION_ACTIVITY_GROUPS` between `working` and `idle`,
renders with the filled green check (`pass-filled` +
`testing.iconPassed`), keeps showing under "Working now" so the user
still sees pending work, and flows through `countWorkingSessions`,
`sessionStatusLabel` ("Finished") and `sessionFreshnessLabel`
("Finished").

The red `error` icon on the `dead` kind already handles the "agent
stopped because of usage limit / crash" case the user also asked
about; this change does not widen that signal.

Verification: `node -c` on both copies of `extension.js` and
`session-schema.js` in `vscode/` and `templates/vscode/`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Screenshot feedback: when most agents are idle with uncommitted
changes, the Overview still said "6 working agents" because
`countWorkingSessions` and `buildWorkingNowNodes` treated the new
`finished` kind as working. That defeats the point of the green
check — the user wants the summary to drop the count as soon as an
agent goes idle.

- `countWorkingSessions` now counts only `working || blocked`.
- New `countFinishedSessions` is exposed through `buildRepoOverview`
  and `syncRepoEntries` as `finishedCount`.
- `buildOverviewDescription`, `buildActiveAgentsStatusSummary` and
  the statusbar tooltip now surface `N finished agent(s)` between
  the working and idle counts, so the Summary card can read
  `2 working agents · 4 finished agents · 0 idle agents` instead of
  `6 working agents · 0 idle agents`.
- `buildWorkingNowNodes` drops `finished`; `buildIdleThinkingNodes`
  re-admits it so finished agents appear with the green check under
  Idle / thinking instead of pretending to still be working.

Verification: `node -c` on both copies of `extension.js`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NagyVikt NagyVikt merged commit f83540c into main Apr 23, 2026
0 of 5 checks passed
@NagyVikt NagyVikt deleted the agent/claude/finished-icon-on-active-agents-tree branch April 23, 2026 21:02
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.

1 participant