Skip to content

fix(sidebar): an opened Agents list says its times as of now - #3804

Merged
devswha merged 1 commit into
mainfrom
fix/agents-list-time-after-fold
Nov 13, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/agents-list-time-after-fold

Conversation

@devswha

@devswha devswha commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Change

Follow-up to #3777, from the merge pass's review of it. The Agents list draws each agent's time in its state from a clock that ticks every 30 seconds, and only while the list is open and a row has a time to say. Folding the list stopped the clock, and its first tick came half a minute after it started again, so a list opened two hours later went on saying <1m for up to thirty seconds. A phone's drawer, where the list starts folded, showed that at every opening.

The clock is now set as its updates start again, in the commit that opens the list and before it is painted (AgentSidebar.tsx). Nothing else of the list changes, and DESIGN.md's rule for the times stands: they are redrawn in steps while the list is open.

The changelog fragment is changelog.d/agents-list-time-after-fold.md.

Validation

At 33413ab, one commit on main at f2e8674, on the maintainer's pool of check VMs:

  • Fast checks: release guards, workflow syntax, fresh generated types and themes, typecheck and build pass. The unit tests: 16931 pass and 1 fails. That one is on the pool's list of tests that fail only on its VMs (server/copilot.test.ts "keeps a logged binding when only the log's timestamps change"), in a file this PR does not touch.
  • The three browser scripts that cover the Agents list (agent-state-groups-demo-regression.ts, sidebar-tokens-demo-regression.ts, sidebar-activity-demo-regression.ts): pass, each on its first run.
  • New unit test (src/components/AgentSidebar.test.tsx), on a fake clock with no sleep: an agent seen to finish says <1m; the list is folded, two hours pass, and it is opened; its row says 2h at once. It fails on main with <1m, and fails again with the one line of the fix taken out.

Not run: the integration suite and the other browser scripts (the change is one effect in AgentSidebar.tsx), Safari, and the Windows and macOS jobs.

The clock the times are drawn from ticks only while the list is open and a row
has a time to say, and it stood still meanwhile. Its first tick came half a
minute after it started again, so a list opened after two hours went on saying
"<1m" for up to thirty seconds. A phone's drawer, where the list starts folded,
showed that at every opening.

The clock is now set as its updates start again, in the commit that opens the
list, before it is painted.

Found by the merge pass's review of #3777, with the test this commit adds.

Co-authored-by: sisyphus-dev-ai <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Agent state times now refresh when reopening a folded list, including on phones when the list starts folded.

When the Agents list reopens, AgentSidebar refreshes displayed agent-state ages before paint. A regression test checks the displayed age after the list remains folded for two hours.

Changes: Agent time refresh

Layer / File(s) Summary
Refresh and verify ages on reopen
src/components/AgentSidebar.tsx, src/components/AgentSidebar.test.tsx, changelog.d/agents-list-time-after-fold.md
A layout effect refreshes now when ticking resumes. The regression test verifies that reopening shows 2h after a two-hour fold. The changelog records the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • devswha/ovis#3505 — The issue concerns displaying how long an agent has been in its current state. This PR refreshes that display when the list reopens.

Possibly related PRs

  • devswha/ovis#3777 — This PR introduced the per-agent elapsed time and foldable state groups that this change updates.
Merge Risk: Minimal · up to 33413

Reopening the Agents list now shows current agent-state times immediately instead of stale ones. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: an opened Agents list now shows its state times as of now. It matches the fix in AgentSidebar.tsx, which syncs the displayed age when the list opens. The title is spec…
Description check Passed The description follows the repository template. The Change section explains the problem: the 30-second clock stops while the list is folded, so a reopened list can show a stale time such as <1m for u…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: an opened Agents list now shows its state times as of now. It matches the fix in AgentSidebar.tsx, which syncs the displayed age when the list opens. The title is specific and uses the fix(sidebar) convention. It does not describe the changelog or the test.

Full details: Description check

Explanation

The description follows the repository template. The Change section explains the problem: the 30-second clock stops while the list is folded, so a reopened list can show a stale time such as <1m for up to thirty seconds. It also explains the fix and names the changelog fragment. The Validation section lists the fast checks, the browser scripts, the new unit test, and the checks not run. It does not mention contract-test coverage, which the template asks for on HTTP/WS changes. This PR does not appear to touch HTTP/WS, so the gap is minor. The Change section also does not link an issue, but it references #3777 as the follow-up.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2293318 and 33413ab.

Files selected for processing: 3

  • changelog.d/agents-list-time-after-fold.md
  • src/components/AgentSidebar.test.tsx
  • src/components/AgentSidebar.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@devswha

devswha commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner Author

GitHub's Browser regression (other scripts) is red at 33413ab on one script. scripts/phone-back-demo-regression.ts timed out on both of its runs at line 348: 30 seconds waiting for a tab's close question (.confirm-dialog), on the self-hosted runner. The other 206 scripts passed there, and Integration and browser is red only because of it.

This PR changes one effect in AgentSidebar.tsx. It touches neither that script nor the tab strip.

On the maintainer's pool of check VMs the same script passes on its first run, in 24 seconds, both for this head merged with main at 2293318 (the tree GitHub tested) and for that main alone. On the runner its two attempts took 127 and 231 seconds.

Nothing was pushed to run the check again, and no timeout was changed.

Update, 08:24 UTC. The job was run again (attempt 2; nothing was pushed) and passed, 207 of 207. scripts/phone-back-demo-regression.ts passed there on its first run, in 47 seconds. One other script, scripts/push-health-demo-regression.ts, passed only on its second run in that attempt, after a 30-second timeout on a click at its line 248; this PR does not touch that one either.

@devswha
devswha merged commit a744b94 into main Nov 13, 2026
21 of 23 checks passed
@devswha
devswha deleted the fix/agents-list-time-after-fold branch November 13, 2026 08:24
@devswha

devswha commented Nov 13, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 33413ab11bdf as a744b9410a79 on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
claude CLEAR
codex CLEAR

Two reviewers at this head: Claude (Opus) CLEAR, Codex Terra CLEAR with no findings. Follow-up to #3777 from its review; src/ only, so the release freeze does not cover it.

After the Agents section had been folded, opening it showed each agent's time as it was when it was folded, for up to 30 s (an agent idle for two hours read <1m); the section starts folded in the phone drawer. The clock is now set when the list opens, before it is painted. The Opus reviewer took that one line out and saw the new test fail (2h expected, <1m received); 48 tests pass at this head.

Left, LOW (Claude): the test would not notice if the update moved to after the paint (one frame of the old time).

The first run of this head failed one browser script twice, scripts/phone-back-demo-regression.ts:348 (a timeout), which this PR does not touch; the job passed on a rerun.

devswha added a commit that referenced this pull request Nov 13, 2026
## Summary
`scripts/phone-back-demo-regression.ts` failed on #3804's run
43386193239 (Browser regression, other scripts) at line 348. It waited
30 s for `.confirm-dialog` after tapping a tab's close button in the
tablet scene. #3804 changes only `src/components/AgentSidebar*`.

Closing a tab asks first only while its agent is busy, or when it is the
last tab. The tablet scene opened the demo's api pane, whose turn ends
4.5 s after load (`site/demo/transport.ts`). When the tap came after
that, as it can on a loaded runner, the idle tab closed without a
question and the wait timed out. This is the cause #3768 fixed in
`phone-safe-area`.

The tablet scene is now two scenes:
- The first keeps the row menu and the final Back out of the app, on the
api pane as before. It no longer closes a tab.
- The new scene opens the web pane, whose agent waits on its question
for good. It opens a new terminal beside it and asserts two tabs. It
then switches back to the web pane's tab, because only the active tab
shows its close, and closes it. With another tab present, the question
comes from the busy check in `TabStrip.requestClose`, not from the
last-tab rule. Back closes the question, and both tabs stay.

`open()` takes the pane as an optional last argument and defaults to the
api pane.

## Validation
- `bun scripts/phone-back-demo-regression.ts` (after `bun run build`)
passes.
- It also passes with a temporary 6 s wait before the close, which is
not committed. Main with the same wait fails at line 348.
- `bun run check fast` passes.
- No changelog fragment, because the change is test-only.
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