Skip to content

Harden GUI smoke regressions#263

Merged
TraderSamwise merged 10 commits into
masterfrom
chore/tui-smoke-next-7
Jun 28, 2026
Merged

Harden GUI smoke regressions#263
TraderSamwise merged 10 commits into
masterfrom
chore/tui-smoke-next-7

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • fix app route/tab navigation so project query context survives tab, sidebar, worktree, and detail navigation
  • harden app heartbeat/reconnect handling and suppress expected transient poll warnings during local restarts
  • fix blocked/offline agent action affordances and remove stale optimistic success UI
  • keep project tmux host sessions alive long enough for service/dashboard spawn flows to settle

Verification

  • yarn --cwd app test
  • yarn --cwd app typecheck
  • yarn --cwd app lint (passes with existing warnings)
  • yarn typecheck
  • yarn lint
  • yarn vitest
  • yarn build
  • live Chrome MCP smoke pass on http://localhost:8081 with /private/tmp/gui-smoke-repo
  • aimux restart recovery smoke pass

Summary by CodeRabbit

  • Bug Fixes
    • Corrected unread notification label pluralization.
    • Improved project-scoped routing by syncing the active project query parameter across the main layout, tabs, and project sidebar.
    • Stabilized thread loading/refresh and improved handling when endpoints are unavailable.
    • Resume actions now appear only when a session can resume.
    • Improved heartbeat/SSE error messages, event parsing, and transport behavior.
    • Worktree actions now show only error feedback; agent creation no longer displays the created session ID.
  • Tests
    • Added/expanded coverage for session resume logic and heartbeat/view-location behaviors.

@vercel

vercel Bot commented Jun 28, 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 28, 2026 7:12pm

@coderabbitai

coderabbitai Bot commented Jun 28, 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: 19b3962c-bff2-49ca-ae12-d812d7422280

📥 Commits

Reviewing files that changed from the base of the PR and between 1bba13c and c4166f3.

📒 Files selected for processing (1)
  • app/app/(main)/(tabs)/(threads)/threads.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/app/(main)/(tabs)/(threads)/threads.tsx

📝 Walkthrough

Walkthrough

This PR updates tmux session recovery, heartbeat transport selection, URL-based tab routing, and several agent-related UI and logging behaviors.

Changes

Tmux Session Resilience

Layer / File(s) Summary
Retry and keepalive changes
src/tmux/runtime-manager.ts
ensureProjectSession retries after a no-such-session failure, and the default dashboard/window command changes to tail -f /dev/null.
Session retry tests
src/tmux/runtime-manager.test.ts
Tests cover keepalive creation and session recreation after runtime-contract and configuration-phase drops.

Heartbeat Native EventSource Transport

Layer / File(s) Summary
Transport selection and dispatch updates
app/lib/heartbeat.ts
startHeartbeat now picks native EventSource on loopback browser connections without a token, trims payloads before parsing, and simplifies listener registration.
Heartbeat transport tests
app/lib/heartbeat.test.ts
Tests add mocked EventSource handling, cleanup, blank-payload coverage, and native-vs-polyfill loopback cases.

URL-Search-Param-Driven Tab Navigation

Layer / File(s) Summary
buildViewPath helper and tests
app/lib/view-location.ts, app/lib/view-location.test.ts
buildViewPath builds Href strings from pathname plus filtered query params, with tests for encoded project paths and empty queries.
Main tab navigation from search params
app/lib/main-tabs.ts
useMainTabNavigation reads project from global search params, falls back to the selected project path, and uses router.replace.
Mobile and sidebar route paths
app/components/MobileTabBar.tsx, app/components/ProjectSidebar.tsx
Both components derive routed project paths from URL state and use router.replace(buildViewHref(...)) for tab and sidebar navigation.
MainLayout URL sync and offline suppression
app/app/(main)/_layout.tsx
MainLayout syncs the project query parameter on project-scoped routes, suppresses offline polling warnings, and stringifies heartbeat errors.

Agent Lifecycle, Refresh, and UI Feedback

Layer / File(s) Summary
Resume eligibility and thread refresh
app/lib/agent-lifecycle.ts, app/lib/agent-lifecycle.test.ts, app/components/agent-actions.tsx, app/app/(main)/(tabs)/(threads)/threads.tsx
canResumeSession is added and used to gate the resume button; ThreadsScreen switches to serialized refresh handling with a token ref.
Panel feedback and notifications
app/components/agent-create-panel.tsx, app/components/worktree-management-panel.tsx, app/components/screens/AgentChatScreen.tsx, app/app/(main)/(tabs)/(inbox)/notifications/index.tsx, app/stores/projectViews.test.ts
AgentCreatePanel removes created-session state, WorktreeManagementPanel uses error-only feedback, AgentChatScreen stringifies heartbeat warnings, and the inbox label pluralizes correctly.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐇 I hopped through tmux and kept the shells alive,
Then sniffed the heartbeats where loopback streams arrive.
I followed the URL crumbs, one path, then two,
And the resume-button garden learned what rabbits knew.
Noisy logs grew quieter, badges learned to say “s,”
Hop hop — this patch smells like progress, I confess.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.78% 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 matches the PR’s main goal of hardening GUI smoke regressions and is concise enough for history scanning.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/tui-smoke-next-7

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/app/(main)/(tabs)/(threads)/threads.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


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

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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.

Actionable comments posted: 2

🤖 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 `@app/app/`(main)/_layout.tsx:
- Around line 58-66: Update the project-scope detection so root dashboard detail
routes are included, not just the exact "/" path. In the path-matching logic
used by isProjectScopedPath() and the PROJECT_SCOPED_PATH_PREFIXES list, add the
dashboard detail prefixes for /agent and /service so the URL-sync effect runs on
those screens. Keep the change aligned with the existing routing helpers in
_layout.tsx and the related URL-sync code that relies on the project-scoped
check.

In `@app/lib/heartbeat.ts`:
- Around line 82-89: The EventSource selection in heartbeat setup should avoid
the native browser transport whenever an authorization token is present, since
`window.EventSource` cannot send auth headers. Update the logic in the heartbeat
flow around `getNativeBrowserEventSource` and the `es` initialization so the
native `EventSource` is used only for unauthenticated connections, and
authenticated SSE continues through `EventSourcePolyfill` with headers.
🪄 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: a9339a5c-b2f1-404f-8533-3b3510e966fa

📥 Commits

Reviewing files that changed from the base of the PR and between 789868f and 066a181.

📒 Files selected for processing (19)
  • app/app/(main)/(tabs)/(inbox)/notifications/index.tsx
  • app/app/(main)/(tabs)/(threads)/threads.tsx
  • app/app/(main)/_layout.tsx
  • app/components/MobileTabBar.tsx
  • app/components/ProjectSidebar.tsx
  • app/components/agent-actions.tsx
  • app/components/agent-create-panel.tsx
  • app/components/screens/AgentChatScreen.tsx
  • app/components/worktree-management-panel.tsx
  • app/lib/agent-lifecycle.test.ts
  • app/lib/agent-lifecycle.ts
  • app/lib/heartbeat.test.ts
  • app/lib/heartbeat.ts
  • app/lib/main-tabs.ts
  • app/lib/view-location.test.ts
  • app/lib/view-location.ts
  • app/stores/projectViews.test.ts
  • src/tmux/runtime-manager.test.ts
  • src/tmux/runtime-manager.ts
💤 Files with no reviewable changes (1)
  • app/components/worktree-management-panel.tsx

Comment thread app/app/(main)/_layout.tsx
Comment thread app/lib/heartbeat.ts Outdated
@TraderSamwise
TraderSamwise merged commit f09689f into master Jun 28, 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