Skip to content

Webview agent pane waits on live daemon requests - #35206

Merged
teamleaderleo merged 10 commits into
feat-cmux-nextfrom
lane/webview-agent-pane-transport-deadlines
Nov 4, 2026
Merged

teamleaderleo merged 10 commits into
feat-cmux-nextfrom
lane/webview-agent-pane-transport-deadlines

Conversation

@teamleaderleo

Copy link
Copy Markdown
Collaborator

Leo said: “shouldn't be this short. no reason for this. i imagine there's other nonsensical gates like this to remove in the broader app/acpmux”

Webview agent-pane transport requests now remain pending while the WebSocket is open and the daemon is alive. Requests mark visible progress as “Waiting for the agent service”; closed sockets still reject promptly and reconnect retries continue without a terminal cap. The mock supports ?mock&slowDaemon and the regression tests cover a slow but alive daemon.

Gates audited:

Gate Verdict
webviews/src/agent-session/acpmux/direct.ts:4280 request deadlines progress marker; no wall-clock rejection while socket is open
webviews/src/agent-session/acpmux/direct.ts:3427 reconnect backoff unbounded backoff up to browser timer maximum
webviews/src/agent-session/acpmux/direct.ts:3450 busy retry cap removed for retryable reads; controls still fail busy refusals
webviews/src/agent-session/acpmux/composerDraft.ts:139 5 s write timeout removed; web-swap late hold retained for cleanup
webviews/src/agent-session/acpmux/cloudUploads.ts:30 30 s page step timeout removed; cancellation remains
webviews/src/agent-session/acpmux/conversation/RepoRecoveryCard.tsx:99 60 s wait removed; native call owns liveness
webviews/src/agent-session/acpmux/useCloudChatRecovery.ts:47 60 s recovery deadline removed; retries continue while active
webviews/src/agent-session/acpmux/peerCloudMachine.ts:16 60-read start cap removed; polling stops on stage change/unmount
webviews/src/agent-session/acpmux/perf.ts:307 10 s next-commit timeout retained as test/perf observation timeout
webviews/src/agent-session/acpmux/folderTrust.ts:74 1.5 s trust read retained authority fallback; no prompt without an authoritative answer
webviews/src/agent-session/acpmux/composer/attachmentSources.ts:16 1.5 s source attribution retained optional attribution fallback; chips do not wait
webviews/src/agent-session/acpmux/tailCache.ts:66 250 ms host tail retained cache warmup fallback; cold attach is not blocked

Validation: bun test webviews/src/agent-session/acpmux/transportDeadlines.test.ts webviews/src/agent-session/acpmux/requestBudget.test.ts (fleet run after PR creation).

agent-identity footer --repo manaflow-ai/cmux
🤖 Generated with Codex

Agent session: agent session

Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-6f9c700029b79752592a
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review e256f8f: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr35206 -f ref=lane/webview-agent-pane-transport-deadlines -f platform=macos -f backend_mode=local

Gallery before/after for f211299: 16 states rendered, 0 images differ, 3565 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41828711818 -R manaflow-ai/cmux -n gallery-advisory-35206-f211299a544b531f4b79c4eb0f526ee6bf5a3559 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.auth-health/signed-in Apple System Colors Light unchanged 0% own mock.ts
agent-pane.auth-health/signed-in Apple System Colors unchanged 0% own mock.ts
agent-pane.auth-health/signed-out Apple System Colors Light unchanged 0% own mock.ts
agent-pane.auth-health/signed-out Apple System Colors unchanged 0% own mock.ts
agent-pane.auth-health/expired Apple System Colors Light unchanged 0% own mock.ts
agent-pane.auth-health/expired Apple System Colors unchanged 0% own mock.ts
agent-pane.auth-health/unknown Apple System Colors Light unchanged 0% own mock.ts
agent-pane.auth-health/unknown Apple System Colors unchanged 0% own mock.ts
agent-pane.chat-width/standard Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/standard Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide Apple System Colors unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors Light unchanged 0% own App.tsx
agent-pane.chat-width/wide-blocks Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/short-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/short-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/wide-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/wide-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-edge/no-edge Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-edge/no-edge Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-floats/scrolled-to-end Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-floats/scrolled-to-end Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-floats/composer-grown Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-floats/composer-grown Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-40 Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-40 Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-56 Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-56 Apple System Colors unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-72 Apple System Colors Light unchanged 0% own App.tsx
agent-pane.composer-rest-gap/gap-72 Apple System Colors unchanged 0% own App.tsx
agent-pane.continuation-spacing/shipped Apple System Colors Light unchanged 0% own App.tsx
agent-pane.continuation-spacing/shipped Apple System Colors unchanged 0% own App.tsx

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

Unclear: web / react-apps-check failed: no known signature; failed step: Check webview test shards. This PR merged before its CI finished: fix forward on main.

CI failed on f211299a54 (run 41828712254 attempt 1): 1 code, 1 unknown.

Job Verdict Why
web / react-apps-check (1) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs agent-pane-select-drag.test.ts chromium at zoom 1.25: a drag along a line of a reply selects words on that line: failed (job)
  • seen on other PRs session-chip-browser.test.ts dark received: the session chip sits on the icon's centre line, padded, a link, lit alone: failed (job)
  • seen on other PRs session-chip-browser.test.ts light received: the session chip sits on the icon's centre line, padded, a link, lit alone: failed (job)
  • seen on other PRs thread-rail-pending-load.test.ts hovering a far pending tick shows that prompt's words: failed (job)
  • seen on other PRs thread-rail-pending-load.test.ts clicking a far pending tick lands on its prompt in one read, and no tick moves: failed (job)
  • seen on other PRs thread-rail-pending-load.test.ts a sweep across many pending ticks reads the index at most once: failed (job)
Matched log lines
web / react-apps-check (1): (fail) chromium at zoom 1.25: a drag along a line of a reply selects words on that line [1745.12ms]

Not re-run automatically: web / react-apps-check (1), web / react-apps-check 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, seen on other PRs that it failed on another pull request's run lately.

red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base fbf7e36; does not block
red: web / Web status; a job it gathers is red on this change (its line here); do not merge until green; see lane-rules
red: web / react-apps-check; a job it gathers is red on this change (its line here); do not merge until green; see lane-rules
red: web / react-apps-check (1); no finished base run on fbf7e36 to compare; do not merge until green; see lane-rules

Shipped in:

@teamleaderleo teamleaderleo added the leo-named-fix An obvious fix to something Leo named: lands on push, review runs in parallel label Nov 4, 2026
@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 4, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Found 20 test failures on Blacksmith runners:

Failures

Test View Logs
---/--- View Logs
---/--- View Logs
---/--- View Logs
/tmp/tmp41qfop52/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpade3h4v_/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs

...and 10 more test failures. View all on Blacksmith: run 41828712367, run 41828712254

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

Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-6f9c700029b79752592a
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-6f9c700029b79752592a
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-6f9c700029b79752592a
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-6f9c700029b79752592a
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-6f9c700029b79752592a
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 4, 2026 11:35 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 4, 2026 11:36 Inactive
teamleaderleo and others added 2 commits November 4, 2026 12:16
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-6f9c700029b79752592a
…t-deadlines' into lane/webview-agent-pane-transport-deadlines
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-6f9c700029b79752592a
@teamleaderleo
teamleaderleo merged commit a628f50 into feat-cmux-next Nov 4, 2026
158 of 166 checks passed
@teamleaderleo
teamleaderleo deleted the lane/webview-agent-pane-transport-deadlines branch November 4, 2026 12:31
@lawrencecchen

Copy link
Copy Markdown
Contributor

@teamleaderleo this PR made the feat-cmux-next web-lint red (check:fixed-waits on transportDeadlines.test.ts). The fix is in #35409. In that test the mock delay was instant (new MockAcpmuxSocket(() => Promise.resolve())), so the slow reply never crossed the 20 ms deadline. Only the 350 ms wait made the test pass, and it passed with the old direct.ts too. #35409 holds the reply until the waiting snapshot shows. It also fixes the mock.ts type error, the stale STARTING_READS test and an unused result that were hidden behind it.

Still red, and not in #35409: 5 tests in test/cloud-chat-resume.test.tsx assert the 60 s resume deadline this PR removed (a hung inventory fails at the original recovery deadline, a hung recheck fails at the original recovery deadline, switching chats cancels a hung inventory/recheck without failing the new recovery, a timed-out attach's late rejection leaves a newer resume running). They need your new contract.

teamleaderleo added a commit that referenced this pull request Nov 4, 2026
#35206 left feat-cmux-next red on the webview checks (nightly webview checks, so
no NEXT nightly publishes):

- typecheck: agent-pane-peer-copy-paused.test.tsx imported STARTING_READS, which
  #35206 removed on purpose (a stuck start is read until it leaves the starting
  stages). The test now asserts that contract: 75 ticks, past the old 60-read
  cap, are 75 reads, and the timer is never cleared.
- typecheck: mock.ts narrowed cmuxAcpmuxMockSlowMs through a repeated cast,
  which TS does not carry; read it once into a local.
- check:fixed-waits: transportDeadlines.test.ts waited a fixed 350 ms. Its mock
  delay resolved at once, so the reply came back in under 1 ms and only that
  wait made "elapsed > 20" pass. The test now holds the slow reply until the
  client's snapshot reports daemonWaitingSince (the 20 ms threshold passed),
  checks the request is still pending, then releases it and expects {}.
  Mutating expectReply's deadline back to a reject makes it fail.

Verified on a fleet host at f4ebcbc: base typecheck 2 errors and
check:fixed-waits 2 waits; head typecheck and check:fixed-waits pass, both
test files 9/9 in 5 runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64
@lawrencecchen

Copy link
Copy Markdown
Contributor

@teamleaderleo #35423 rewrites the 5 red cloud-chat-resume tests to the behavior this PR set. A resume now ends when its request answers, when the native call fails for good (the daemon is gone), or when the person leaves the chat.

One gap this PR does not state: a cloudMachine.list or recheck that never answers while the bridge stays alive keeps the resume waiting until the person leaves the chat. While it waits, the card has no cancel and its actions are disabled. I did not add a timeout. The tests assert this behavior explicitly, so a change is visible. If you want a cancel action or a liveness end there, please decide it.

teamleaderleo added a commit that referenced this pull request Nov 4, 2026
…mat)

- useCloudChatRecovery.ts:79 bound the recheck's result to a variable it never
  read (#35206); vp lint fails on that warning. The await stays; the binding goes.
- transportDeadlines.test.ts: vp fmt.

`bun run check` in webviews/ passes on this branch merged with feat-cmux-next
5f776e0 (base: 3 red, fixed-waits, vp lint, vp check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64
lawrencecchen added a commit that referenced this pull request Nov 4, 2026
…ind it, from #35206 (#35409)

check:fixed-waits failed on transportDeadlines.test.ts (2 fixed waits, baseline 0). The
350 ms wait was not just a style violation: the test built the mock with an instant delay,
so the "600 ms slow reply" came back in under 1 ms and only the wait made the elapsed-time
assertion pass. The test passed with direct.ts from before #35206 too.

- transportDeadlines.test.ts: the mock holds the slow method's reply until the test sees the
  client's waiting snapshot (daemonWaitingSince), the event the 20 ms deadline causes on an
  open socket; then it releases the reply and checks the request resolves and the waiting
  state clears. No wall-clock wait. Pre-#35206 direct.ts: fails with native.timed_out.
- mock.ts: read the slow-method globals once (TS2345 number | undefined; vp check red).
- agent-pane-peer-copy-paused.test.tsx: #35206 removed STARTING_READS on purpose (reads
  continue while the machine starts); the test now proves reads go past the old 3-minute
  cap with the interval kept (TS2339 and a runtime failure before).
- useCloudChatRecovery.ts: drop the binding #35206 left unused (vp lint no-unused-vars).

check:pieces stops at the first red, so the last three were hidden behind check:fixed-waits.

Red/green (bun test, webviews/):
- transportDeadlines.test.ts: head 5/5 pass; with a628f50^ direct.ts: fail, native.timed_out.
  Landed version with a628f50^ direct.ts: pass (it did not test the fix).
- agent-pane-peer-copy-paused.test.tsx: head 8/8 pass; with a628f50^ peerCloudMachine.ts:
  1 fail (interval cleared after 60 reads).
lawrencecchen added a commit that referenced this pull request Nov 4, 2026
… removed 60 s deadline (#35423)

#35206 removed useCloudChatRecovery's 60 s recovery deadline on purpose ("removed; retries
continue while active"; "a busy machine never turns a slow list into a terminal resume
failure"). Five tests still asserted that deadline and failed on the tip.

A resume now ends when its request answers (the resume goes on), when the native call fails
for good (non-retryable: the daemon is gone; the card shows the error), or when the person
leaves the chat (switch, deactivate, unmount). The tests now prove each end, with fake timers
and held requests the test answers or fails; no wall-clock wait:

- a slow inventory/recheck keeps the resume waiting past the old deadline (10 min) with no
  timer and no repeated read, until it answers; the answer runs the recheck and the next read.
- new: a slow inventory/recheck whose daemon is gone fails the resume with the error.
- switching chats ends a hung inventory/recheck with no error and no timer; the old chat's
  late answer or failure does not touch the new recovery or read for the old chat.
- an attach left pending when its resume ends (now: the daemon is gone, was: the deadline):
  its late rejection leaves a newer resume running; the current attach owns its failure.

Gap, not invented here: #35206 states no end for a request that never answers while the
bridge stays alive. Today that resume waits until the person leaves the chat (the card has no
cancel and disables its actions while resuming). The first two tests assert that explicitly.

bun test test/cloud-chat-resume.test.tsx: head 12/12 pass (3 runs). With the hook from
a628f50^, 6 fail (the waits now end at its 60 s deadline timer).
teamleaderleo added a commit that referenced this pull request Nov 4, 2026
… build (#35450)

* try-pr.sh: try a pull request the cheapest way, live when it needs no build

scripts/cmux-next/try-pr.sh PR reads the PR's diff with git and sorts it with
live_apply.py (the rules from the 8,315-PR live-apply study). A web-only PR goes
straight to web-overlay.sh follow, so the running app hot-reloads it with no
build; a CI/tests/docs PR is nothing to try; a daemon, Swift or resource change
says why it needs a new binary and, with --build, requests the fleet dev build
tagged pr-N.

Tests: python3 -m unittest scripts/cmux-next/tests/test_live_apply.py (10 pass);
dry runs on #35314 (rebuild), #35408 (no-app), #35206 and #35205 (web-live).

Leo-ask: ask-ffdcb76e34

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f164a6206bf2ef9c6b7d

* try-pr.sh: lockfiles, bundled scripts and web config are not no-app; honest doc numbers

Review follow-ups on #35450: the extension rule now runs after the web, resource
and Rust rules, the doc no longer counts swift-live as needing no binary, and
--port with no value prints usage.

Leo-ask: ask-ffdcb76e34

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f164a6206bf2ef9c6b7d

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
ci-routing-agent — f211299a Deployed Nov 4, 2026 by teamleaderleo via cmux-tui tree preflight #111586
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

leo-named-fix An obvious fix to something Leo named: lands on push, review runs in parallel risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants