Skip to content

Record TUI repair notices#345

Merged
TraderSamwise merged 4 commits into
masterfrom
chore/core-sidecar-next-70
Jul 6, 2026
Merged

Record TUI repair notices#345
TraderSamwise merged 4 commits into
masterfrom
chore/core-sidecar-next-70

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a shared dashboard repair notice ring for TUI API recovery and runtime-guard repair
  • flash/record API recovery start/success/failure and runtime repair start/success/failure/blocked states
  • update north-star tracker with repair notice location and focused regression evidence

Tests

  • yarn typecheck
  • yarn lint
  • yarn build
  • yarn vitest run

Summary by CodeRabbit

  • New Features
    • Added dashboard repair notices for recovery events, including started, succeeded, failed, blocked, and waiting states.
    • Improved recovery visibility with clearer footer messages and in-dashboard status updates.
  • Bug Fixes
    • Tightened recovery checks so success is only reported after required resources and connection state are fully verified.
    • Reduced repeated “repair already running” notifications by rate-limiting blocked notices.
  • Tests
    • Expanded coverage for runtime guard repair and scheduled TUI recovery scenarios, including success, failure, blocking, and pending recovery cases.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jul 6, 2026 8:26pm

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f204a32-dfaa-4e68-9420-affa60dbf769

📥 Commits

Reviewing files that changed from the base of the PR and between 4414741 and 7d194ac.

📒 Files selected for processing (1)
  • docs/north-star-completion-tracker.md
📝 Walkthrough

Walkthrough

This PR adds a new repair-notice module (recordDashboardRepairNotice) that writes bounded entries to host.dashboardRepairNotices, integrates it into the runtime-guard auto-repair flow and scheduled TUI API recovery flow with phase tracking (started/blocked/succeeded/failed/waiting), changes refreshCriticalResources to return a structured result, and updates documentation and tests accordingly.

Changes

Dashboard repair notice recording

Layer / File(s) Summary
Repair notice module
src/multiplexer/repair-notices.ts, src/multiplexer/repair-notices.test.ts
New module defines DashboardRepairNoticeKind/Phase types, DashboardRepairNotice interface, and recordDashboardRepairNotice, which appends bounded entries, logs, and conditionally flashes/renders; test verifies non-dashboard-mode behavior.
Runtime-guard repair notice wiring
src/multiplexer/dashboard-control.ts, src/multiplexer/dashboard-control.test.ts
startRuntimeGuardRepair/refreshRuntimeGuard record started/blocked/failed/succeeded notices, rate-limit blocked notices via runtimeGuardRepairBlockedNoticeAt, and gate success flash; tests assert notice contents across scenarios.
TUI API recovery result and notice recording
src/multiplexer/tui-api-runtime.ts, src/multiplexer/tui-api-runtime.test.ts
refreshCriticalResources returns attempted/missing/failed resource lists instead of void; runScheduledTuiApiRecovery records started/succeeded/waiting/failed notices based on verification of critical resources and connection readiness; tests cover success, failure, and pending/unverified scenarios.
Documentation updates
docs/north-star-completion-tracker.md
Marks repair-notice checklist items done, adds a "Repair notices" section, and adds a scorecard row for TUI repair observability.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

  • TraderSamwise/aimux#221: Both modify the guarded-repair flow in dashboard-control.ts's startRuntimeGuardRepair/refreshRuntimeGuard path.
  • TraderSamwise/aimux#233: Both modify the same scheduled TUI API recovery/probing path in tui-api-runtime.ts.
  • TraderSamwise/aimux#341: Both modify refreshCriticalResources/connection-state handling in the scheduled recovery flow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding shared TUI repair notice recording.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/core-sidecar-next-70

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
src/multiplexer/repair-notices.test.ts (1)

5-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test coverage only exercises the non-flash branch.

The flash-enabled path (host.mode undefined or "dashboard", setting footerFlash/footerFlashTicks/calling renderCurrentDashboardView) and the 20-entry ring bound are untested here. Given this module is now wired into two recovery flows, covering the flash branch and the bounding behavior would guard against regressions.

🤖 Prompt for 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.

In `@src/multiplexer/repair-notices.test.ts` around lines 5 - 28, Add tests for
the flash-enabled path in recordDashboardRepairNotice by covering hosts in
dashboard mode and with no mode so footerFlash, footerFlashTicks, and
renderCurrentDashboardView are asserted, and add a case that records more than
20 notices to verify the ring buffer behavior. Keep the existing non-dashboard
assertion, but expand repair-notices.test.ts to exercise both branches and the
bounded dashboardRepairNotices collection.
src/multiplexer/tui-api-runtime.ts (1)

524-533: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

"waiting" notices aren't rate-limited, unlike the new blocked-notice throttle in dashboard-control.ts.

Every scheduled recovery attempt during a sustained outage records a "waiting" notice (default flash: true), which both flashes the footer and appends to the bounded 20-entry dashboardRepairNotices ring on each retry cycle. This can quickly evict earlier, more informative entries (e.g. the initial "started" notice) and repeatedly re-flash the footer for the duration of an outage. dashboard-control.ts already introduced runtimeGuardRepairBlockedNoticeReady to rate-limit a similar repeated-notice scenario; applying an analogous throttle here would keep the notice ring and footer flashing meaningful during prolonged reconnect loops.

🤖 Prompt for 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.

In `@src/multiplexer/tui-api-runtime.ts` around lines 524 - 533, The repeated
"waiting" notice in the recovery path is not throttled, so each reconnect loop
keeps flashing the footer and pushing older entries out of the
dashboardRepairNotices ring. Add a rate-limit similar to dashboard-control.ts’s
runtimeGuardRepairBlockedNoticeReady around the recovery branch in
tui-api-runtime.ts, and gate the recordDashboardRepairNotice call for the
"waiting" phase so it only emits periodically during a sustained outage while
preserving the existing recovery state updates on host.tuiApiRecoveryPending.
src/multiplexer/repair-notices.ts (1)

24-45: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider a typed host interface instead of any.

recordDashboardRepairNotice accepts host: any, so typos on dashboardRepairNotices, footerFlash, footerFlashTicks, or renderCurrentDashboardView won't be caught at compile time, even though the primary caller (dashboard-control.ts) otherwise uses a well-typed DashboardControlHost.

♻️ Proposed typed host interface
+interface RepairNoticeHost {
+  mode?: string;
+  dashboardRepairNotices?: DashboardRepairNotice[];
+  footerFlash?: string;
+  footerFlashTicks?: number;
+  renderCurrentDashboardView?: () => void;
+}
+
 export function recordDashboardRepairNotice(
-  host: any,
+  host: RepairNoticeHost,
   notice: Omit<DashboardRepairNotice, "at" | "error"> & { error?: unknown },
   opts: RepairNoticeOptions = {},
 ): DashboardRepairNotice {
🤖 Prompt for 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.

In `@src/multiplexer/repair-notices.ts` around lines 24 - 45, Replace the `host:
any` parameter in `recordDashboardRepairNotice` with a typed host interface so
accesses like `dashboardRepairNotices`, `footerFlash`, `footerFlashTicks`, and
`renderCurrentDashboardView` are type-checked. Define or reuse a
`DashboardControlHost`-style interface that includes these fields/methods, then
update `recordDashboardRepairNotice` to accept that type instead of `any`. Make
sure the primary caller in `dashboard-control.ts` continues to satisfy the new
host type.
🤖 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.

Nitpick comments:
In `@src/multiplexer/repair-notices.test.ts`:
- Around line 5-28: Add tests for the flash-enabled path in
recordDashboardRepairNotice by covering hosts in dashboard mode and with no mode
so footerFlash, footerFlashTicks, and renderCurrentDashboardView are asserted,
and add a case that records more than 20 notices to verify the ring buffer
behavior. Keep the existing non-dashboard assertion, but expand
repair-notices.test.ts to exercise both branches and the bounded
dashboardRepairNotices collection.

In `@src/multiplexer/repair-notices.ts`:
- Around line 24-45: Replace the `host: any` parameter in
`recordDashboardRepairNotice` with a typed host interface so accesses like
`dashboardRepairNotices`, `footerFlash`, `footerFlashTicks`, and
`renderCurrentDashboardView` are type-checked. Define or reuse a
`DashboardControlHost`-style interface that includes these fields/methods, then
update `recordDashboardRepairNotice` to accept that type instead of `any`. Make
sure the primary caller in `dashboard-control.ts` continues to satisfy the new
host type.

In `@src/multiplexer/tui-api-runtime.ts`:
- Around line 524-533: The repeated "waiting" notice in the recovery path is not
throttled, so each reconnect loop keeps flashing the footer and pushing older
entries out of the dashboardRepairNotices ring. Add a rate-limit similar to
dashboard-control.ts’s runtimeGuardRepairBlockedNoticeReady around the recovery
branch in tui-api-runtime.ts, and gate the recordDashboardRepairNotice call for
the "waiting" phase so it only emits periodically during a sustained outage
while preserving the existing recovery state updates on
host.tuiApiRecoveryPending.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1151ae51-4a32-4efc-bfed-3ba8019f6115

📥 Commits

Reviewing files that changed from the base of the PR and between f28184c and 4414741.

📒 Files selected for processing (7)
  • docs/north-star-completion-tracker.md
  • src/multiplexer/dashboard-control.test.ts
  • src/multiplexer/dashboard-control.ts
  • src/multiplexer/repair-notices.test.ts
  • src/multiplexer/repair-notices.ts
  • src/multiplexer/tui-api-runtime.test.ts
  • src/multiplexer/tui-api-runtime.ts

@TraderSamwise
TraderSamwise merged commit 72713fc into master Jul 6, 2026
3 checks passed
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