feat(plugin): Count up worker run time in the agents pane - #132
Merged
Merged
Conversation
Use createdAt for live and frozen card durations while preserving history ages. Keep redraws at one second and data refresh to no more than one request per five seconds. Co-Authored-By: Codex <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.



Show how long each worker has been running in the agents pane (
/band), counting up once per second while the worker is live, like Claude Code's own turn timer.Before, the card's detail line read
Working · 3m, and that3mwas the age of the last update, not the run time. It also only moved when atool.callorturn.completerefreshed the pane.Now:
working,starting,needs_input) showsnow - createdAt:42s,3m 07s,1h 02m 07s. Zero padding keeps the width steady so the card does not jitter every secondupdatedAt - createdAtThe tick lives in
plugin/hooks/pane-ticker.ts, a small scheduler with injected timers. It runs only while the pane is open and at least one row is live, holds at most one interval, redraws every second without a subprocess, and asks for a data refresh at most every 5 seconds so a worker that finishes while the orchestrator is idle stops counting.register.tsxonly wires it to the transitions it already owns.createdAtwas already incodedeck ps --json, so there is no daemon or CLI change.Worth knowing when reviewing:
processglobal). It was probed in a live PTY on Claude Code 2.1.282:setIntervalfires and can call$.ui.invalidatethrough a$captured insession.start. The result is recorded indocs/mods.md✕still fires no hook, so in that case the tick keeps running until the next toggle or until no row is liveupdatedAt, which a laterrenamealso bumps.pshas no end timestamp. Recorded in the spec as a known limitation