Repository navigation
fix(workspace): New Agent overlay owns no input while hidden; retry after a failed create (#1269, #1270) - #1286
Merged
Merged
Conversation
… after a failed create - #1269: the overlay is retained under display:none by takeovers and the fullscreen editor, and the palette can open it there. Its capture listener ate Escape/arrows/Enter and its owner marker (a querySelector, blind to display:none) blocked every shortcut. Hidden, it now renders nothing and listens to nothing; `open` is kept so it appears when its surface returns. GlobalEditorWorkspaceSlot now provides the retained- surface hidden context too. - #1270: a create that produced no session left the one-shot latch set, so Enter was dead in an overlay that still blocked input. It reopens. - q22: the three spawn-failure toasts in pane.ts showed the raw IPC rejection; they now show SESSION_START_FAILED_MESSAGE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Juliusolsson05
added a commit
that referenced
this pull request
Sep 25, 2026
…ounted overlay; spawn errors flattened at the source - A: useKeybinds' placement gate keyed on the store flag alone, so under Reader/Spotlight/a fullscreen editor the first Escape closed an overlay the user never saw instead of leaving the takeover, and every chord (the palette's included) was dropped. It now requires the overlay to be mounted ([data-new-agent-overlay]), like the TLDR/goal latches. - A2: a stale create settling late reopened the latch for a newer in-flight one (a duplicate agent). The release is now per create generation. - A3: an unplaced spawn (project closed while starting) now says so. - B3 (q22): sessionSpawnErrorMessage returned the raw provider exception, and newTab, reload, provider switch, rewind, capability reload and the orchestration tool error all showed it. It now returns the curated proxy or missing-folder text, or the safe sentence. - B1/B2/B4: tests pin the slot composition both ways, all three pane.ts spawn catches, and the latch's success/rejection/stale outcomes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…res; the missing-CLI sentence survives spawn already maps a rejection to a safe message, but the create toasts dropped it for the generic sentence, so a deleted worktree looked retryable and the proxy hint was lost. One recognizer (curatedSpawnMessage) keeps exactly the three curated failures: Claude proxy startup, a missing folder, and main's ProviderCliNotFoundError, whose sentence now lives in shared. Everything else is still the generic sentence (q22). The unplaced toast names terminals as terminals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom our constants, never copied from the error The missing-folder message was every byte after the prefix, so a provider exception that contained the prefix and then a URL or token passed it to a toast and the orchestration error. The folder named is now the cwd the renderer asked to spawn in. The CLI sentence only names a known provider id. Tests use the reviewer's probes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Final disposition (pre-merge), head 0c5aa6d. Three independent reviewers:
C's round-2 findings are fixed in 0c5aa6d. Nobody has reviewed that commit since; I verified it against the code.
Findings and dispositions: Round 1, A and B (all fixed in 2051233; A and B confirmed in round 2)
Round 2, A and B (test gaps only; none fixed; not blocking)
Round 1, C (at ad6cb3a)
Round 2, C (at 7116732; both fixed in 0c5aa6d; I verified the code)
Residuals:
Merges through batch PR #1318 once every member passes its gate. 🤖 Generated with Claude Code |
Juliusolsson05
added a commit
that referenced
this pull request
Sep 25, 2026
Conflicts resolved (steering q41 overlaps): - RestoreBanner: main's swap/focus + button styling, with the batch's save-failure label; the two test files combined on one mutable context. - BulkProviderSwitchModal: main's DialogActions footer, with #1312's stop (Cancel becomes "Stop after this agent" while locked). - NewAgentPlacementOverlay: main's list keys under #1286's `active` gate; main's new listbox autofocus is gated on `active` too (a hidden overlay must not take focus). - pane.ts: #1286's spawnFailureToast over main's raw err.message toasts (q22). - ConversationsPicker: main's useListNavigation, with #1297's stale guard before nav.onKeyDown for every list key (PageUp/Down, Home/End, ⌃N/⌃P), hover stripped while stale, and `stale` in the reset key. Also fixes main's red CI on 13ae608: nine tests still queried #1221's old accessible names ("everywhere", the recorder's "Add"/"Press keys…"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1269. Fixes #1270.
Refs #1267: this fixes only the renderer side of steering q22. Main still relays the raw exception, so #1267 stays open.
Found by the Stage 3 C4 hunt (
temp/quality-loop/hunt-c4.md). Plan:docs/plans/2026-09-25-new-agent-overlay-traps.md(first commit).#1269: a hidden overlay owned all input
The overlay lives inside the retained workspace, which stays mounted under display:none while Reader, Spotlight, Settings or a fullscreen editor own the screen. The Command Palette is not focus-filtered, so "New Agent…" could open the overlay invisibly. Once open:
useKeybinds' placement gate, which read only the store flag,preventDefaulted every ⌘/⌥ chord and ate the first Escape.Now:
GlobalEditorWorkspaceSlotalso providesWorkspaceSurfaceHiddenContext, OR'ed with the outer value. That covers a fullscreen editor, and a takeover over a split editor.useKeybindsgate treats New Agent as open only when the flag is set and[data-new-agent-overlay]is mounted. Escape leaves Reader or Spotlight, and the palette chord works.openis kept, so the picker appears once its surface is visible again (the flag is not persisted).#1270: a dead overlay after a failed create
A create that returned no session left
committingRefset: Enter did nothing while the overlay still blocked shortcuts. Now:Spawn-failure text (q22)
sessionSpawnErrorMessageis the single place asession:spawnrejection becomes user-facing text. It feeds every spawn toast (create, split, linked, newTab, reload, rewind, provider switch, capability reload) and the orchestration tool error. It returns one of four things, and the text is always built from our own constants, never copied from the error:Workspace folder is missing: <cwd>, where<cwd>is the folder the renderer asked to spawn in, from the sharedMISSING_WORKSPACE_FOLDER_PREFIX(fix(undo-close): a failed restore says why (#1242) #1264);<kind> CLI not found. Open Setup (File › Setup…) …, only for a known provider id, from the new sharedPROVIDER_CLI_NOT_FOUND_SUFFIX, which main'sProviderCliNotFoundErrornow also uses;SESSION_START_FAILED_MESSAGE.The create, split and linked-create toasts re-read the thrown message with the same recognizer, so curated text survives and anything else is the generic sentence.
Tests
NewAgentPlacementOverlay.renderer.test.tsx:focusModeKeyboardOwnership.renderer.test.tsx: Escape and the palette chord work under Reader while New Agent is open but not on screen, and Escape still goes to the visible overlay.controlPlacement.renderer.test.tsx:errorMessage.test.ts:npx tsc -bis clean.Residual
data-new-agent-overlayattribute;mitmdump/Unable to locate mitmneedles.If any of these break, the safe sentence shows, never raw text.
🤖 Generated with Claude Code