Match Exposé status + recency to the dashboard (shared semantics) - #153
Conversation
Exposé mapped raw activity/attention directly (activity:"waiting" → "Waiting", alive-idle → "Idle"), while the dashboard maps the richer deriveSessionSemantics user label (→ "Working" / "Ready"). They disagreed for the same agent. Compute the semantic user label once in the runtime (buildTmuxWindowMetadata) and store it on the tmux window metadata as userLabel; the agent-status chip now prefers userLabel over the raw activity/attention fallback, so Exposé and the dashboard always show the same state. Add ready/offline border tints for the states this newly surfaces. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract the dashboard's per-state time-anchor selection into a reusable sessionRecencyAnchor() (which timestamp to show + its verb: output/prompted/ idle/…). The dashboard renderer now delegates to it, and the runtime computes the same anchor from sessionMetadata.derived and stores recencyAt/recencyLabel on the tmux window metadata. Exposé renders "output 16m ago" / "prompted 1m ago" verbatim, matching the dashboard instead of a bare last-event time. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 13 minutes and 14 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughIntroduces ChangesSession recency anchor integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/multiplexer/session-runtime-core.ts`:
- Around line 402-406: The sessionRecencyAnchor() call is missing latestUnreadAt
and lastUsedAt parameters that are included in the dashboard path, which can
cause recency mismatches for the same session state. Add latestUnreadAt and
lastUsedAt to the object passed to sessionRecencyAnchor() by sourcing these
values from the derived and semantic objects that are already available in this
context, ensuring the parameters match what the dashboard uses.
In `@src/session-recency.test.ts`:
- Around line 15-17: The test function with title "returns null for
working/ready with no output yet" only asserts the working state but claims to
test both working and ready states. Add a second expect statement in this test
to verify that sessionRecencyAnchor with label set to "ready" also returns null,
ensuring both branches mentioned in the test title are properly validated.
In `@src/tui/render/agent-status.test.ts`:
- Around line 34-44: The test description claims that the user label wins over
both activity and attention, but the current test cases in the "prefers the
dashboard-semantic user label over raw activity/attention" test only demonstrate
userLabel overriding activity. Add an additional assertion using agentStatusChip
that passes both activity and attention parameters along with a userLabel to
explicitly verify that userLabel takes precedence over the attention parameter,
ensuring the test intent is fully covered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a3b64a54-7a3e-4e68-9614-929994ca6551
📒 Files selected for processing (9)
src/multiplexer/session-runtime-core.tssrc/session-recency.test.tssrc/session-recency.tssrc/tmux/expose-tile.test.tssrc/tmux/expose.tssrc/tmux/runtime-manager.tssrc/tui/render/agent-status.test.tssrc/tui/render/agent-status.tssrc/tui/screens/dashboard-renderers.ts
- buildTmuxWindowMetadata now passes lastUsedAt and (for needs/blocked/error states only, to keep the common path cheap) latestUnreadAt into sessionRecencyAnchor, so Exposé's prompted/blocked/failed anchors match the dashboard's exact timestamp rather than falling back to output/idle. - Add the missing ready null-path assertion and an attention-conflict case to the userLabel-precedence test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What
Exposé and the dashboard were computing an agent's state and recency from different inputs, so they disagreed (e.g. dashboard "Working" vs Exposé "Waiting"; dashboard "output 16m ago" vs Exposé a bare "16m ago"). This makes them share a single source of truth.
Status label parity
activity/attentiondirectly; the dashboard maps the richerderiveSessionSemantics().user.label(e.g.activity:"waiting"→ Working, alive-idle → Ready).buildTmuxWindowMetadata) and stored on the tmux window metadata asuserLabel;agentStatusChipprefers it over the raw fallback. Addedready/offlineborder tints.Recency parity (reusable)
sessionRecencyAnchor()(src/session-recency.ts) — returns which timestamp to show and its verb (output/prompted/idle/blocked/failed/offline).sessionMetadata.derivedand storesrecencyAt+recencyLabel; Exposé rendersoutput 16m ago/prompted 1m agoverbatim.Preview
Known follow-up
The runtime doesn't plumb per-session unread-notification time / last-used time into window metadata, so for
needs input/blocked/errorthe anchor value falls back to last-output/became-idle (verb is exact; working/ready/idle cases are exact).Tests
sessionRecencyAnchorcoverage, userLabel-precedence coverage, and updated Exposé tile tests.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Style
Tests