Skip to content

Harden dashboard startup guard lifecycles - #235

Merged
TraderSamwise merged 1 commit into
masterfrom
chore/next-20260623-tui-connection-adapter-10
Jun 23, 2026
Merged

Harden dashboard startup guard lifecycles#235
TraderSamwise merged 1 commit into
masterfrom
chore/next-20260623-tui-connection-adapter-10

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • keep dashboard startup model priming independent of input epochs
  • keep startup repair model refreshes data-scoped while render/error effects stay lifecycle guarded
  • allow guarded dashboard quit to pass through so disconnected repair states cannot trap the user

Verification

  • yarn vitest run src/multiplexer/session-launch.test.ts src/multiplexer/runtime-guard.test.ts
  • yarn typecheck && yarn lint && yarn vitest run && yarn build

Summary by CodeRabbit

  • Bug Fixes
    • Fixed issue where quit command was blocked during runtime rebuild scenarios, preventing users from exiting the application.
    • Improved dashboard startup to properly handle user interactions occurring during initialization, ensuring data integrity and preventing state corruption.

@vercel

vercel Bot commented Jun 23, 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 Jun 23, 2026 7:42am

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 50413567-5214-4208-8319-13e7a23996f9

📥 Commits

Reviewing files that changed from the base of the PR and between e0af861 and 681df60.

📒 Files selected for processing (4)
  • src/multiplexer/runtime-guard.test.ts
  • src/multiplexer/runtime-guard.ts
  • src/multiplexer/session-launch.test.ts
  • src/multiplexer/session-launch.ts

📝 Walkthrough

Walkthrough

The q key is added to GUARD_PASSTHROUGH_KEYS in the runtime guard so quit is never swallowed by a disconnected guard. In runDashboard, startup priming now captures a lifecycle without { inputEpoch: true }, and the repair path is split into two captures: one with { inputEpoch: true } for validity checking and one without for the actual model refresh.

Changes

Runtime guard q key passthrough

Layer / File(s) Summary
q added to passthrough keys and tests updated
src/multiplexer/runtime-guard.ts, src/multiplexer/runtime-guard.test.ts
GUARD_PASSTHROUGH_KEYS is extended to include q with a comment about preventing user trapping. Disposition tests move q from swallowed to passthrough, and handleRuntimeGuardKey tests assert q returns false without calling renderCurrentDashboardView.

Session-launch lifecycle split for priming vs repair

Layer / File(s) Summary
Dual lifecycle capture in runDashboard
src/multiplexer/session-launch.ts, src/multiplexer/session-launch.test.ts
Startup priming uses a lifecycle captured without { inputEpoch: true }. Repair splits into a inputEpoch: true "render" lifecycle for the validity predicate and a plain "model" lifecycle for refreshDashboardModelThroughApi. Tests update the expected inputEpoch from 0 to undefined for priming and add an async test that defers priming, simulates later input, and confirms priming retains inputEpoch: undefined with correct busy-state and error clearing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TraderSamwise/aimux#216: Directly related — covers the runtime-rebuild-required guard overlay UI and key hints (including q quit), the same guard state whose quit-swallowing behavior this PR changes.
  • TraderSamwise/aimux#226: Directly connected at the lifecycle-token usage level — introduced lifecycle-aware refresh APIs (refreshDashboardModelFromService) and coordination that this PR's inputEpoch lifecycle split builds on.
  • TraderSamwise/aimux#234: Closely related — adjusts runtime-guard repair behavior and lifecycle/key handling in the same files, including footerFlash removal and inputEpoch alignment that this PR continues.

Poem

🐇 The q key once vanished, trapped deep in the guard,
No exit was offered — the user was barred.
Now passthrough it flows with a quick little hop,
The lifecycle splits so the epoch won't stop.
Priming stays pure while repair checks its stage —
A disciplined rabbit turns a tidy new page! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main objective: hardening dashboard startup guard lifecycles, which aligns with all three primary changes described in the PR objectives.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/next-20260623-tui-connection-adapter-10

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

@TraderSamwise
TraderSamwise merged commit e001f38 into master Jun 23, 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