Show green check when agent finished editing worktree#407
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deriveSessionActivityinsession-schema.jsnow returns a newfinishedkind when the worktree is dirty but no file activity has happened forIDLE_ACTIVITY_WINDOW_MS(2 min).workingstays reserved for fresh file changes.extension.jswiresfinishedthroughSESSION_ACTIVITY_GROUPS,SESSION_ACTIVITY_ICON_IDS(pass-filled+testing.iconPassedgreen),iconColorId,countWorkingSessions,buildWorkingNowNodes,buildIdleThinkingNodes,workingSessionSortKey,sessionStatusLabel("Finished") andsessionFreshnessLabel("Finished").deadalready renders with the rederroricon 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.jsvscode/guardex-active-agents/session-schema.jstemplates/vscode/guardex-active-agents/extension.jstemplates/vscode/guardex-active-agents/session-schema.js(kept byte-identical to the non-template copy)Test plan
node -con all four JS files.🤖 Generated with Claude Code