Repository navigation
fix(antigravity): preserve continuation through slow Windows terminal startup - #21770
Conversation
|
Independent verification update:
Scoped verdict: Approve stacked with #21657. The PR’s rendered awin before/after proof covers the observed 8.3-second PTY binding case; WSL/SSH/paired-host continuation remains unverified. |
|
Independent verification (2026-09-20):
Verdict: approve with #21657 in stack order for the observed slow Windows PTY startup. WSL/SSH/paired-host behavior remains unverified. No merge performed. |
ELI5 / evidence / trade-offs auditELI5: If agy takes a while to start, Orca keeps waiting and then continues the same task instead of giving up too early. Proof: macOS/Windows tests and awin before/after evidence pass; no additional UI artifact was produced for this timing path. User-facing trade-off: Slow hosts can remain in a waiting state longer before a failure is reported. This note scopes the claim to the evidence above; it does not claim untested remote, SSH, WSL, or vendor combinations. |
* fix(antigravity): publish captured command approvals to Chat * fix(antigravity): bind native hook screen evidence to runtime terminal * fix(antigravity): settle cancelled approvals at the idle composer * fix(antigravity): clear approval while accepted commands run
There was a problem hiding this comment.
Important
The Windows PTY-budget fix is sound and well covered. One real correctness gap in the accompanying approval-screen publisher — a connected PTY that no longer holds its pane can clear or overwrite that pane's live permission prompt — plus a doc/behavior mismatch on the new budget coupling.
Reviewed changes
Reviewed the full 26-file diff: commit b4e4c264e9 (the PR's stated change) and the merged 85f6d81594 (#21776's approval feature).
- Antigravity PTY-spawn budget —
spawnTimeoutMsbecomesmax(8000, readinessTimeoutMs)for antigravity, so a PTY that binds at ~8.3 s is no longer abandoned; other agents keep 8 s. - Command-approval screen classifier —
isAntigravityCommandApprovalScreenplusblockedReason: 'agent-approval-prompt'inclassifyTerminalScreenReadiness, with four captured Windows agy transcripts. - Screen-permission publication —
AntigravityScreenPermissionPublisherschedules a screen read per PTY chunk, andAgentHookServer.ingestAntigravityScreenPermissionwrites/clears the approval into the canonical status store. - Host wiring —
onTerminalScreenPermissionwired inmain-process-runtime-service.tsandorcad-entry.ts.
ℹ️ The description covers only one of the two commits in the diff
nwparker/agy-chat-permission (#21776) was merged into this branch, so the head commit and roughly 1,400 of the 1,494 added lines are the command-approval feature — not the renderer wait. The description's "Only the renderer's bounded wait changes" is therefore inaccurate, and a reader coming to the diff cold would not know to expect the new runtime publisher, the dual-host onTerminalScreenPermission wiring, or the {"approval":{…}} interactivePrompt shape now published to the status store. Worth updating the description (or noting the merge) so the reviewed scope matches the diff.
Technical details
# Description vs. reviewed scope
## Affected sites
- `src/main/runtime/antigravity-screen-permission-publisher.ts` — new runtime publisher.
- `src/main/runtime/orca-runtime-visible-snapshot-preview.ts:20-43` — new wiring.
- `src/main/agent-hooks/server/server-ingest-antigravity-screen.ts` — new store writer.
- `src/main/startup/main-process-runtime-service.ts:88`, `src/main/orcad/orcad-entry.ts:236` — new host callbacks.
## Required outcome
- The PR description should account for the merged `#21776` delta, or the branch should be rebased so the diff matches the stated change.ℹ️ Nitpicks
- The antigravity case of
bounds missing-PTY waits for $agent at $timeoutMs ms(antigravity-continuation-delivery.test.ts:90-112) advances the full 60 s and then only asserts the promise resolvedfalse, so it passes with either an 8 s or a 60 s bound; only theclaudecase actually pins its bound. The first new test does pin antigravity at 8,307 ms, so coverage is not absent — just this case's name promises more than it checks.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| const terminalHandle = this.getAgentStatusTerminalHandleForPaneKey(pty.paneKey) | ||
| const row = this.getAgentProviderSessionRowsForPaneFn?.(pty.paneKey)?.find( | ||
| (candidate) => | ||
| candidate.providerSessionOnly !== true && candidate.agentType === 'antigravity' | ||
| ) | ||
| // Native hooks identify the pane; the runtime owns its live terminal binding. | ||
| return row && terminalHandle ? { ...row, terminalHandle } : null |
There was a problem hiding this comment.
baseline resolves the status row and terminal handle from the scheduled PTY's recorded paneKey, but never checks that the scheduled PTY still holds that pane. A connected PTY the graph has since rebound away from its pane (the codebase's own "orphaned" state — see ptyHoldsRecordedSurface) therefore reads the pane's current row while reading its own screen, and the ingest guards cannot tell: baseline.terminalHandle is derived from the pane, so it always equals previous.terminalHandle.
Technical details
# Cross-pane attribution in the Antigravity screen publisher
## Affected sites
- `src/main/runtime/orca-runtime-visible-snapshot-preview.ts:26-32` — `baseline(ptyId)` reads `pty.paneKey` and resolves the pane's current row/handle without confirming `ptyId` still holds that pane.
- `src/main/agent-hooks/server/server-ingest-antigravity-screen.ts:26-27` — the `terminalHandle` mismatch guard compares the pane's current handle on both sides, so it cannot catch a different source PTY.
## Failure
1. Pane `P` is bound to `ptyB`; its screen shows the agy dialog, so the publisher writes `state: 'waiting'` with `interactivePrompt` `{"approval":{"source":"antigravity-screen",…}}`, `observation: O`, `terminalHandle: HB`.
2. `ptyA` is still connected but its recorded `paneKey` is `P` (the graph rebound `P` to `ptyB`; `recordPtySurfaceClaim` never clears the old claim). `ptyA` emits output → `schedule(ptyA)` → `baseline(ptyA)` returns `{ ...row_P, terminalHandle: HB }`, `readScreen(ptyA)` returns ptyA's idle composer, `isCurrent(ptyA, …)` passes.
3. `publish({ baseline, command: null, clearedState: 'done' })` → ingest sees a matching observation, a matching handle and `ownsPrompt === true`, and clears ptyB's still-live prompt to `done`. The mirror case publishes an approval for a dialog ptyB never showed.
## Required outcome
- A screen read from a PTY must only be attributed to a pane that PTY still holds, or the observation must carry the source PTY's own terminal handle so the existing mismatch guard can reject it.
## Suggested approach (optional)
- Gate `baseline` on `ptyHoldsRecordedSurface(pty, this.ptySurfaceTopology())`, or require `this.getPtyRecordForPaneKey(pty.paneKey)?.ptyId === ptyId`, and add a regression for an orphaned connected PTY.
## Open questions for the human
- The only open reachability question is how often an orphaned PTY is simultaneously connected and emitting; the mechanism itself is verified in the current code.| // Windows Antigravity launches can bind their PTY after the ordinary eight-second budget. | ||
| spawnTimeoutMs: | ||
| agent === 'antigravity' | ||
| ? Math.max(PTY_SPAWN_TIMEOUT_MS, readinessTimeoutMs) | ||
| : PTY_SPAWN_TIMEOUT_MS, |
There was a problem hiding this comment.
For antigravity the PTY-spawn budget is now the composer budget, so a launch whose PTY never appears reports failure at 60 s instead of 8 s (the start-timeout toast and markNativeChatLaunchPromptFailed move with it), while the JSDoc at line 63-64 and the new comment at line 39 still say the two budgets are separate and that timeoutMs overrides only the readiness budget.
Technical details
# Antigravity spawn and composer budgets are now coupled
## Affected sites
- `src/renderer/src/lib/agent-paste-draft.ts:100-104` — `spawnTimeoutMs = max(8000, readinessTimeoutMs)` for antigravity.
- `src/renderer/src/lib/agent-paste-draft.ts:39` — comment: "PTY binding and composer readiness have separate budgets (STA-3367)".
- `src/renderer/src/lib/agent-paste-draft.ts:63-64` — JSDoc: "`timeoutMs` overrides the readiness budget only; waiting for the PTY to spawn keeps its own budget."
## Required outcome
- The comment/JSDoc and the code should agree on whether an explicit `timeoutMs` also extends the PTY-spawn wait, and a genuinely failed Antigravity launch should not wait the full composer budget before its failure verdict.
## Open questions for the human
- Is 60 s the intended worst case for a missing PTY, or should the missing-PTY budget stay short (e.g. 8-20 s) while only a late-appearing PTY earns the extended composer budget? The current code cannot distinguish the two, so this is a product call.* feat(agents): deprecate Gemini CLI setup in favor of Antigravity * fix(i18n): register Gemini deprecation copy * fix(i18n): refresh runtime catalog after legacy setup labels * test(agents): expect legacy Gemini label in skill coverage * fix(antigravity): preserve continuation through slow Windows terminal startup (#21770) * fix(antigravity): retain handoffs through slow Windows PTY binding * fix(antigravity): show command approvals in Chat (#21776) * fix(antigravity): publish captured command approvals to Chat * fix(antigravity): bind native hook screen evidence to runtime terminal * fix(antigravity): settle cancelled approvals at the idle composer * fix(antigravity): clear approval while accepted commands run

ELI5
On Windows, Continue in New Session could open Antigravity with an empty input box and report that the context could not be sent. Orca gave up waiting for the terminal just before Windows finished starting it.
What Changed
Antigravity terminal binding now gets at least its configured composer-readiness budget (60 seconds by default), instead of the ordinary eight seconds. After binding, the existing execution-host composer check still decides whether context may be sent. Other agents keep their eight-second binding limit.
Why
Reproduced twice in the exact branch build on awin. In the instrumented run, Windows registered the new PTY 8,307 ms after the tab appeared; the eight-second timeout had already abandoned delivery. Extending the existing bounded wait covers that observed failure without changing terminal-screen detection or permitting a paste before readiness. A missing PTY still times out and unsubscribes. Default Antigravity binding plus composer waits can now total up to two minutes.
Linked Issue
Refs #17408, #18088. Follow-up to #21657, stacked on #21682.
Visual Proof
Before: actual Windows continuation session opens with an empty composer; the handoff never arrives. The captured notification said “The new Antigravity session started, but its context could not be sent.”
After: the rebuilt Windows renderer retained the context even when the PTY took 8,330 ms to bind. The actual dialog delivered the handoff, agy read the disposable checkout, answered that the previous verification was complete, and returned to an idle composer.
Testing
Review
Only the renderer's bounded wait changes. Existing host ownership, capability checks, pane identity, trust-dialog refusal and verified input delivery remain authoritative. No path, shell, credential, wire, or status-store changes. Folder workspaces use the same tab path. Live Linux/WSL/SSH continuation is not claimed.
Agent skill upstream boundary
Checklist