Skip to content

feat: direct acpmux React agent pane - #17856

Closed
azooz2003-bit wants to merge 40 commits into
feat/acpmux-ts-pane-basefrom
feat/acpmux-ts-pane-direct
Closed

azooz2003-bit wants to merge 40 commits into
feat/acpmux-ts-pane-basefrom
feat/acpmux-ts-pane-direct

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

This PR carries the React TypeScript agent pane over a direct authenticated acpmux WebSocket client. Swift hosts WKWebView and provides the endpoint, token, and initial session. React attaches, folds the versioned event stream, pages history, handles permissions and queue state, and sends ACP actions directly. Native remains the default renderer.

The renderer uses Pretext-style measurement, memoized row versions, typed-array geometry, binary-search virtualization, scroll anchoring, registry-based React row components, and hot-reloaded theme, layout, and user renderers. The standalone preview includes Claude and Codex recordings, real-speed streaming replay, seeded 5,000-row transcripts, permission and queue fixtures, theme controls, width controls, and fling timing.

Base and recovery

This PR uses the owned base branch feat/acpmux-ts-pane-base, which contains the pre-React acpmux pane snapshot. It does not use or update Lawrence's branches.

The earlier PR #16042 was opened against the wrong stacked base and auto-merged into that parent. This replacement PR is the direct-to-acpmux implementation on an owned base so it can be reviewed and merged independently.

The projections RFC is https://github.com/manaflow-ai/cmuxterm-hq#1051: acpmux owns sessions and event history, Swift hosts, and React and native are both clients.

Preview

cd webviews
bun run preview:dev
bun run preview:build

Static output: webviews/dist/acpmux-agent-session-preview/.

Validation

  • bun test src/agent-session/acpmux/model.test.ts src/agent-session/acpmux/direct.test.ts (8 passed)
  • bun x tsgo --noEmit
  • ./scripts/build-agent-session-web.sh
  • ./scripts/build-webviews-app.sh --check
  • Swift package tests require macOS CI because this Linux host cannot import the package's existing Darwin dependency.
  • Lawrence's native seeded-row fling reference is p50 and p95 8.33 ms at 120 Hz. Comparable TypeScript numbers still require macOS or fleet measurement.

Changelog

Added: React TypeScript agent pane over a direct authenticated acpmux event stream, with a standalone preview harness.


Summary by cubic

Adds a React TypeScript agent session pane that renders a direct authenticated acpmux WebSocket stream. Swift stays the WKWebView host and passes the authenticated loopback endpoint, per-launch token, and selected session through a new versioned bridge; React pages the event stream, merges in-flight events with paged history, creates sessions, merges daemon model, mode, and config catalogs, handles prompt acknowledgements and permission and queue state, sends ACP actions, and routes native-only actions (copy, open URL, open file, focus) back through the host bridge.

Lifecycle hardening ignores stale attach replies, session selections, and history pages, persists new sessions before prompting, settles optimistic sends, preserves tool update metadata, computes turn durations, pairs turn summaries without duplicate rows across daemon versions, preserves turn boundaries and duplicate queued prompts with their session defaults, retains implicit turn rows during history replay, keeps fallback transcript events visible during reconnects, and keeps non-edit tool activity visible alongside edited-file details. Every session change reopens the transcript at its latest turn, and the composer stays ready across live snapshots. The transcript uses Pretext measurement aligned with the rendered markdown blocks, coalesces streaming thoughts, binary-search virtualization, memoized rows, cached prepared markdown blocks, code copying, and LCS-based edited-file diff counts. Native rendering remains the default.

Renderer selection

  • New app.agentSession.renderer config selects native (default) or TypeScript for new agent session panes; the catalog key placement mirrors the schema nesting so validation stays consistent.
  • The session picker refreshes whenever the daemon session list changes, even if the selected session is unchanged, and new agent panes created from command-line tokens now resolve to the configured renderer instead of hardcoding React.

Preview

  • Standalone preview at webviews/src/agent-session/acpmux-preview replays recorded Claude and Codex streams with seeded 5,000-row transcripts, permission and queue fixtures, and theme and width controls.

Written for commit 00937c1. Summary will update on new commits.

Review in cubic


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

teamleaderleo and others added 30 commits September 30, 2026 13:22
Add the versioned Swift bridge, React transcript renderer, Pretext layout model, customization registry, and standalone preview harness. Keep native rendering as the default.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Move transcript projection and ACP actions into the React client. Keep Swift as the WKWebView host and pass an authenticated loopback endpoint through the versioned handshake.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Handle permission envelopes, settle optimistic prompts, and reset streaming rows between turns. Install the webview lockfile before bundling Pretext resources in CI.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merge in-flight events with attach pages, reconcile legacy prompt echoes, and mark rejected sends failed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Emit snapshots for session-list changes even when the selected session is unchanged, so the picker stays current for sessions created or purged elsewhere.\n\nCo-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Handle prompt acknowledgements, preserve tool update metadata, compute turn durations, and reset session-local reducer state. Restore the compiled Tailwind asset pipeline and align markdown measurement with the rendered blocks.\n\nCo-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Pair turn_end and turn_result summaries without duplicate rows, preserve duration and state across session resets, and account for code block padding in precomputed geometry. Keep fallback transcript events visible during reconnects.\n\nCo-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merge daemon model catalogs, expose new-session creation, and show edited-file diff counts. Add code copying and keep the generated web assets aligned with the React renderer.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ignore stale history responses after session changes and keep non-edit tool activity visible alongside edited-file details.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Use an LCS line diff for ACP edit blocks so replacement changes report both additions and deletions accurately.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reuse a pending turn-end summary when a later turn result supplies the turn id, avoiding duplicate transcript cards across daemon versions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Keep the shell, scroller, spacer, thread, row, composer, and markdown geometry rules in the source and generated WebKit assets.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reset virtual transcript anchors when the selected session changes so each session opens at its newest content.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Use the app section prefix required by the settings catalog so CmuxSettings validation and generated config schema stay consistent.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Move agentSession.renderer under app in the public and embedded cmux.json schemas so the catalog key and schema validation agree.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
teamleaderleo and others added 10 commits September 30, 2026 16:15
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c977ef23-3666-4b64-8ae6-fe6385f9482d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​marked@​17.0.51001001009880
Addednpm/​@​chenglou/​pretext@​0.0.91001009990100

View full report

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Probably yours: Fast static checks failed: a static check failed, FAILED feature-flags (1.72s).

CI failed on 00937c1a6e (run 37524806915 attempt 1): 2 code.
macOS jobs did not run: compile and app tests were skipped: Fast static checks failure.

Job Verdict Why
Fast static checks code a static check failed
guards / workflow-guard-tests / preflight code a Python test failed
Matched log lines
Fast static checks: FAILED feature-flags (1.72s)
guards / workflow-guard-tests / preflight: FAIL: test_every_advertised_path_is_supported (__main__.ConfigurationReviewPathsTests.test_every_advertised_path_is_supported)

Not re-run automatically: Fast static checks, guards / workflow-guard-tests / preflight are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way.

@blacksmith-sh

blacksmith-sh Bot commented Oct 6, 2026

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_list_supported_matches_schema_settings_paths (main.SupportedPathsTests.test_li
st_supported_matches_schema_settings_paths)/
test_list_supported_matches_schema_settings_paths (main.SupportedPathsTests.test_li
st_supported_matches_schema_settings_paths)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

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.

2 participants