Skip to content

Wave 1: frontend-stack modernization + structured tmux model in agentd (Frontend Command Center UX program) - #86

Merged
cvsloane merged 13 commits into
mainfrom
refactor/frontend-command-center
Jul 20, 2026
Merged

cvsloane merged 13 commits into
mainfrom
refactor/frontend-command-center

Conversation

@cvsloane

@cvsloane cvsloane commented Jul 20, 2026 •

Copy link
Copy Markdown
Owner

First wave of the Frontend Command Center UX program (tasks/2026-07-20-frontend-tmux-ux-master-plan.md, owner-locked decisions 2026-07-20). Per-wave deploy cadence: this PR is intended to merge and deploy on its own.

FW1-MODERN (frozen 76d3c5e, attempt 1)

  • TypeScript 7.0.2 across all workspaces (native compiler; @typescript/native-preview alias for Next route type-gen; lint parser isolated in tools/eslint-typescript-compat).
  • ESLint 10 + eslint-plugin-react-hooks unpinned to 7.1.1 (SessionList fixed properly; MobileLaunchSheet exhaustive-deps fixed).
  • React 19.2.7 + types; tailwind-merge 3; lucide-react 1.x. Mechanical only — no behavior change; Zod stays 3.x (moves in Wave 2); visualizer deps untouched.

FW1-TMUX-GO (frozen eaadfe9 + R2 7a8e6ee, attempt 2)

  • Structured tmux model in agentd: extended pane/window metadata (active/zoom/layout/flags/sizes), debounced tmux.topology snapshots driven by tmux hooks with poll reconciliation.
  • 8 new window/pane executor commands (new/kill/rename/select window, split/select/resize/zoom pane) + frozen protocol fixtures (the Wave-2 TS contract).
  • Terminal resume now supersedes stale channels after a control-plane restart (closes the deferred W4-TERM-CLIENT item); scrollback range paging proven.
  • R2 corrections from adversarial review: topology emission is config-gated default-OFF (tmux.topology_events), hook snapshot filtering + startup cleanup of crash leftovers, stale-viewer TTL sweep.

Verification chain

  • Both lanes: AI Lead gate re-runs at frozen SHAs (TS chain + Go suite) — green.
  • Integrated tree: full wave gate (lint, typecheck, test:ci, dashboard smoke, production build, go build/vet/test) — green.
  • Independent adversarial review: initial HOLD (caught the topology/CP-termination hazard) → R2 corrections → re-review verdict SHIP, all findings closed with end-to-end tests.

Deploy notes

  • Safe for the mixed-version window: topology emission defaults off, so the currently deployed agentd behavior is unchanged and a newly built agentd stays quiet until Wave 2.
  • Do NOT roll out the new agentd binary yet — the control plane learns tmux.topology + the new command schemas in Wave 2 (FW2-CONTRACTS). Binary rollout is deliberately deferred.
  • No database migrations in this wave.

Program state: tasks/frontend-ux-status.md · log: tasks/frontend-ux-log.md · acceptance: tasks/frontend-ux-acceptance-checklist.md

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added tmux window and pane controls, including create, rename, close, select, split, resize, and zoom.
    • Added structured tmux topology updates with session, window, and pane status, dimensions, layout, and activity details.
    • Added optional real-time topology events, disabled by default.
  • Bug Fixes
    • Improved terminal reconnection and resume behavior by safely replacing stale attachments.
    • Added cleanup for stale terminal viewers and abandoned session state.
  • Tests
    • Expanded coverage for tmux operations, topology events, hooks, protocol messages, and reconnect scenarios.

cvsloane and others added 9 commits July 20, 2026 09:08
…oard, wave 1 briefs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ind-merge 3, lucide 1.x (FW1-MODERN 76d3c5e)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ecutor, stale-channel supersede, scrollback paging proof, protocol fixtures (FW1-TMUX-GO eaadfe9)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rection round

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ne, stale viewer TTL sweep (FW1-TMUX-GO-R2 7a8e6ee)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cvsloane, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 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: 8d0175f1-69a2-46fc-8ba2-1e2bc8c2a069

📥 Commits

Reviewing files that changed from the base of the PR and between 540080c and 2b105bc.

📒 Files selected for processing (8)
  • agents/agentd/cmd/agentd/main.go
  • deploy/Dockerfile.control-plane.base
  • deploy/Dockerfile.dashboard.base
  • tasks/2026-07-20-fw2-contracts-brief.md
  • tasks/2026-07-20-fw2-term-brief.md
  • tasks/frontend-ux-acceptance-checklist.md
  • tasks/frontend-ux-log.md
  • tasks/frontend-ux-status.md
📝 Walkthrough

Walkthrough

This PR adds structured tmux topology reporting, hook-based reconciliation, window and pane commands, stale terminal recovery, protocol fixtures, frontend ESLint and TypeScript modernization, control-plane cleanup, and Wave 1 planning and handoff documentation.

Changes

Structured tmux control and lifecycle

Layer / File(s) Summary
Tmux protocol contracts
agents/agentd/internal/protocol/*, agents/agentd/internal/config/*
Adds topology payloads, window/pane command payloads, extended pane metadata, and the default-off topology_events setting.
Topology reconciliation and hooks
agents/agentd/cmd/agentd/*, agents/agentd/internal/tmux/*
Collects deterministic tmux topology, supports hooks with polling fallback, debounces topology events, and restores existing hooks on shutdown.
Window and pane command execution
agents/agentd/cmd/agentd/main.go, agents/agentd/internal/tmux/tmux.go
Adds validated commands for creating, renaming, killing, selecting, splitting, resizing, and zooming tmux windows and panes.
Terminal reconnect recovery
agents/agentd/internal/tmux/terminal.go, agents/agentd/cmd/agentd/main.go
Marks channels stale after disconnects, permits stale resume replacement, and sweeps stale viewer resources.
Protocol and integration validation
agents/agentd/**/*_test.go, tests/fixtures/protocol/*
Adds tmux integration tests, reconnect tests, hook tests, topology tests, and protocol round-trip fixtures.

Frontend toolchain modernization

Layer / File(s) Summary
Flat ESLint configuration
eslint.config.mjs, apps/dashboard/eslint.config.mjs, tools/eslint-typescript-compat/*, package.json, */package.json
Replaces legacy ESLint invocation and configuration with flat configs, compatibility parser wiring, updated rules, and output ignores.
Frontend dependency and JSX updates
apps/dashboard/package.json, apps/dashboard/src/*, tsconfig.base.json
Updates TypeScript, React-related packages, Node typings, memoization dependencies, and React Three Fiber JSX declarations.

Control-plane cleanup

Layer / File(s) Summary
Query and runtime error handling
services/control-plane/src/db/*, services/control-plane/src/services/*, packages/ac-cli/src/config.ts
Adjusts SQL parameter placeholder construction, removes redundant initializers, and preserves config errors as causes.

Frontend UX program records

Layer / File(s) Summary
Program plans and acceptance criteria
tasks/2026-07-20-*.md, tasks/frontend-ux-acceptance-checklist.md
Adds the frontend UX master plan, study findings, Wave 1 briefs, correction brief, and acceptance checklist.
Lane handoffs and status records
tasks/frontend-ux-handoffs/*, tasks/frontend-ux-status.md, tasks/frontend-ux-log.md, tasks/frontend-ux-metrics.jsonl
Adds handoff conventions, frozen lane records, status tracking, execution logs, and metrics events.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.92% 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 two main changes: frontend-stack modernization and structured tmux model work in agentd.
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 refactor/frontend-command-center

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

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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
agents/agentd/internal/tmux/tmux_test.go (1)

182-233: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add a timeout to the blocking wait-for call.

Line 193's exec.Command(tmuxCommand, "wait-for", signal) blocks indefinitely if the in-pane background job never signals, unlike other waits in this file which use select/time.After. A regression here would hang the test until the suite-level timeout instead of failing fast.

🕐 Suggested fix
-	if output, err := exec.Command(tmuxCommand, "wait-for", signal).CombinedOutput(); err != nil {
-		t.Fatalf("wait for pane history: %v: %s", err, output)
-	}
+	waitCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+	defer cancel()
+	if output, err := exec.CommandContext(waitCtx, tmuxCommand, "wait-for", signal).CombinedOutput(); err != nil {
+		t.Fatalf("wait for pane history: %v: %s", err, output)
+	}
🤖 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 `@agents/agentd/internal/tmux/tmux_test.go` around lines 182 - 233, Update
TestCapturePaneRangePagesStableContiguousHistory so the blocking tmux wait-for
invocation has a bounded timeout, using the file’s existing
wait/select/time.After pattern or an equivalent command context timeout. Fail
the test promptly with a clear timeout error if the pane job never signals,
while preserving the successful signal-handling path.
🤖 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 `@agents/agentd/cmd/agentd/main.go`:
- Around line 480-488: In the topology initialization flow around
StartTopologyHooks, only register and defer-close tmux topology hooks when
cfg.Tmux.TopologyEvents is enabled. When disabled, skip StartTopologyHooks
entirely while preserving the existing poll-based reconciliation fallback;
retain the current error and success logging for the enabled path.

In `@tasks/2026-07-20-fw1-tmux-go-brief.md`:
- Line 19: Update the tmux hook list in the “tmux hooks” section to remove
invalid after-kill-pane and after-resize-pane entries, and use the master plan’s
verified pane-exited, window-linked, window-unlinked, and client-session-changed
hooks instead. Preserve the existing feature detection, additive registration,
restoration, fallback polling, and reconciliation requirements.

In `@tests/fixtures/protocol/commands-dispatch-new-window.json`:
- Line 1: Replace the personal absolute path in the new_window command fixture’s
cwd field with a generic, non-user-specific placeholder path, while preserving
the rest of the fixture payload unchanged.

---

Nitpick comments:
In `@agents/agentd/internal/tmux/tmux_test.go`:
- Around line 182-233: Update TestCapturePaneRangePagesStableContiguousHistory
so the blocking tmux wait-for invocation has a bounded timeout, using the file’s
existing wait/select/time.After pattern or an equivalent command context
timeout. Fail the test promptly with a clear timeout error if the pane job never
signals, while preserving the successful signal-handling path.
🪄 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: 43811166-aed7-4ed8-bba8-bd33211603fe

📥 Commits

Reviewing files that changed from the base of the PR and between 70fa53e and 540080c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (61)
  • .eslintrc.cjs
  • agents/agentd/cmd/agentd/main.go
  • agents/agentd/cmd/agentd/main_terminal_test.go
  • agents/agentd/cmd/agentd/main_tmux_commands_test.go
  • agents/agentd/cmd/agentd/main_tmux_test.go
  • agents/agentd/cmd/agentd/tmux_topology.go
  • agents/agentd/config.example.yaml
  • agents/agentd/internal/config/config.go
  • agents/agentd/internal/config/config_test.go
  • agents/agentd/internal/protocol/command.go
  • agents/agentd/internal/protocol/messages.go
  • agents/agentd/internal/protocol/session.go
  • agents/agentd/internal/protocol/tmux.go
  • agents/agentd/internal/tmux/hooks.go
  • agents/agentd/internal/tmux/pty_bridge_test.go
  • agents/agentd/internal/tmux/terminal.go
  • agents/agentd/internal/tmux/tmux.go
  • agents/agentd/internal/tmux/tmux_test.go
  • agents/agentd/internal/tmux/viewer_pty.go
  • agents/agentd/internal/ws/client.go
  • agents/agentd/internal/ws/client_test.go
  • agents/agentd/internal/ws/protocol_fixtures_test.go
  • apps/dashboard/eslint.config.mjs
  • apps/dashboard/package.json
  • apps/dashboard/src/components/SessionList.tsx
  • apps/dashboard/src/components/launch/MobileLaunchSheet.tsx
  • apps/dashboard/src/types/react-three-fiber.d.ts
  • eslint.config.mjs
  • package.json
  • packages/ac-cli/package.json
  • packages/ac-cli/src/config.ts
  • packages/ac-schema/package.json
  • services/control-plane/package.json
  • services/control-plane/src/db/automationMemory.ts
  • services/control-plane/src/db/index.ts
  • services/control-plane/src/services/automation.ts
  • services/control-plane/src/services/clawdbot.ts
  • tasks/2026-07-20-frontend-tmux-ux-master-plan.md
  • tasks/2026-07-20-frontend-ux-study-findings.md
  • tasks/2026-07-20-fw1-modern-brief.md
  • tasks/2026-07-20-fw1-tmux-go-brief.md
  • tasks/2026-07-20-fw1-tmux-go-corrections-brief.md
  • tasks/frontend-ux-acceptance-checklist.md
  • tasks/frontend-ux-handoffs/README.md
  • tasks/frontend-ux-handoffs/fw1-modern.md
  • tasks/frontend-ux-handoffs/fw1-tmux-go.md
  • tasks/frontend-ux-log.md
  • tasks/frontend-ux-metrics.jsonl
  • tasks/frontend-ux-status.md
  • tests/fixtures/protocol/commands-dispatch-kill-window.json
  • tests/fixtures/protocol/commands-dispatch-new-window.json
  • tests/fixtures/protocol/commands-dispatch-rename-window.json
  • tests/fixtures/protocol/commands-dispatch-resize-pane.json
  • tests/fixtures/protocol/commands-dispatch-select-pane.json
  • tests/fixtures/protocol/commands-dispatch-select-window.json
  • tests/fixtures/protocol/commands-dispatch-split-pane.json
  • tests/fixtures/protocol/commands-dispatch-zoom-pane.json
  • tests/fixtures/protocol/tmux-topology.json
  • tools/eslint-typescript-compat/eslint.config.mjs
  • tools/eslint-typescript-compat/package.json
  • tsconfig.base.json
💤 Files with no reviewable changes (1)
  • .eslintrc.cjs

Comment thread agents/agentd/cmd/agentd/main.go Resolved
Comment thread tasks/2026-07-20-fw1-tmux-go-brief.md Resolved
cvsloane and others added 4 commits July 20, 2026 11:08
…rogram end

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…uilds, drop deleted .eslintrc.cjs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…abled

Addresses PR review: default-off config no longer mutates the user's tmux
server hooks or triggers per-event ListPanes for dropped events.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cvsloane

Copy link
Copy Markdown
Owner Author

Review threads addressed: (1) hook registration now gated on tmux.topology_events (2b105bc) — valid catch; (2) after-kill-pane/after-resize-pane in the brief: the implementation probes each hook individually and skips unsupported names, so invalid hooks degrade gracefully — brief is a historical work order; (3) fixture cwd path: fixtures are a frozen cross-language contract mid-program and the path is illustrative (same paths appear throughout repo docs) — deliberately unchanged.

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