Repository navigation
fix(cmux NEXT agent pane): a failed screencapture is an error, not an Esc (carries part of #20827) - #27892
Conversation
From #20827: composer.capture treats any screencapture that started as a pick, so one that exits with an error (no Screen Recording grant, a crash) answers the page {cancelled: true}, and a partial file it wrote is left in the temp folder. AgentPaneCapture.capture gets a result type and an executable seam for a stub; the failure path is unchanged here. Co-authored-by: Austin Wang <austinwang115@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-b22822edaca3611659c9
…led and leaves no file From #20827's AgentPaneCapture half. composer.capture now reads screencapture's end: an Esc (no file, nothing said, whatever status the macOS version gives it) is still {cancelled: true}; an end that says why, leaves a partial file or comes from a signal answers the page the capture.failed error ("The screen capture failed.", Austin's string and translations), logs the system's message, and removes the partial file. The rest of #20827 (AgentPaneGitProcess deadlines) is superseded by base moving those runs onto AsyncProcess. Co-authored-by: Austin Wang <austinwang115@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-b22822edaca3611659c9
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 97133a4 to compare; do not merge until green; see lane-rules The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41071509570 at a6ca7ea failed: cmux-next generated files (shared build). |
|
Found 28 test failures on Blacksmith runners: Failures
...and 18 more test failures. View all on Blacksmith
|
…and no image is a failure Review of #27892: with no file, the status no longer decides; an end that says why is capture.failed even at status 0, and only a silent one is an Esc. With a file, status 0 is the image (a partial file at status 0 cannot be told from a capture). Co-authored-by: Austin Wang <austinwang115@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-b22822edaca3611659c9
…ff the main thread Review of #27892: under NonisolatedNonsendingByDefault, capture() ran on its caller's actor (the main actor for composer.capture), so the new FileManager.checked.fileExists/removeItem touched the disk on the main thread. @Concurrent runs it on the global executor, as the module's other async disk work does. Co-authored-by: Austin Wang <austinwang115@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-b22822edaca3611659c9
|
Independent review (codex gpt-6.1-sol high; Astra via SR2 hung): SHIP at 6e2306b No concrete correctness defects found. The capture result handling, signal/status classification, partial-file cleanup, off-main file operations, localization, and regression tests are consistent with the PR description. I did not modify files or run builds. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review (codex gpt-6.1-sol high; carried): SHIP at 3f9fe6e Carried from the independent SHIP at 6e2306b across clean merges of feat-cmux-next (and, where present, an empty CI re-run commit): the PR's own diff against the base is byte-identical (same |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review (codex gpt-6.1-sol high; carried): SHIP at b16d04b Carried from the independent SHIP at 6e2306b across a clean merge of feat-cmux-next 97133a4 (past 4154db0, the CloudAppLinkOwnerAnswerTests test-target compile fix, and the String tables fix): the PR's own diff against the base is byte-identical (same |
|
Reds at
No crash, signal or cut-short test run is among them. The independent SHIP (carried, same patch-id) is in the comments above. Landing pinned to |
|
Shipped in:
|
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Carries the AgentPaneCapture half of #20827 (Austin's error-handling audit for #20776). Those commits credit Austin with
Co-authored-by, and the string and its 21 translations are his. #20827 stays open for its owner to close.The rest of #20827 is superseded: base moved the Changes view's git runs onto
AsyncProcess(92598cb, fcafb74: SIGTERM at the deadline, SIGKILL after the grace, awaited without a thread), which covers itsAgentPaneGitProcessdeadline rewrite. ItsSSHRunnerchange was reformatting only.What it fixes
composer.capture(the composer's + > Attach Screenshot… / Attach Window…) counted everyscreencapturerun that started as a pick. One that ended with an error (no Screen Recording grant, a crash) answered the page{cancelled: true}, the same as an Esc, and any partial file it wrote stayed in the temp folder.AgentPaneCapture.capturereturns.takenor.failed(reason), and takes anexecutableseam so tests can use a stub..failedand the partial file is removed. (A partial file at status 0 can't be told apart from a capture.).taken, no image), whether this macOS version exits 0 or non-zero on Esc. An end that prints why is.failed, even at status 0..failed. On.failedthe system's message is logged (agent-pane.capture) and the page getscapture.failedwith "The screen capture failed."FileManager.checked(the guardrail's seam).Test
AgentPaneCaptureTests(CmuxNextAppTests), with stubscreencapturescripts:aFailedScreencaptureIsAFailureNotACancel: prints a reason and exits 1. Expects.failed. Red at6c1f6a398d6.anErrorSaidWithStatusZeroAndNoImageIsAFailure: prints a reason, exits 0, writes no file. Expects.failed. Added after review.aFailedPickLeavesNoFile: writes a partial file and exits 1. Expects no file left. Red at6c1f6a398d6.anEscapedPickIsTakenWithNoImageandaQuietNonzeroExitWithNoImageIsACancel: an Esc under either exit convention stays a cancel. Green on both commits.Observed / Not run
scripts/cmux-next/prepush-gate.py: no new violations.6c1f6a398d6and the green at the head come from this PR's CI. I have not checked a realscreencaptureEsc status on macOS; the quiet-exit rule is there so either convention stays a cancel.Risk: normal. One reply path in the agent pane; the page already treats a failed call as no attachment (
App.tsx.catch(() => null)).No capture: no visible change on success or Esc; a failed capture answers an error instead of a cancel.
Changelog
Fixed: A screenshot attach that fails no longer reads as a cancel and leaves no temporary file behind.
Agent session: agent session
🤖 Generated with Claude Code