Skip to content

fix(antigravity): show command approvals in Chat - #21776

Merged
nwparker merged 4 commits into
nwparker/agy-windows-spawn-budgetfrom
nwparker/agy-chat-permission
Sep 21, 2026
Merged

nwparker merged 4 commits into
nwparker/agy-windows-spawn-budgetfrom
nwparker/agy-chat-permission

Conversation

@nwparker

@nwparker nwparker commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1139 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1139
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​272 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​269

ELI5

Merge verdict: approve the scoped fix with #21660, in stack order. Final head 646935991b6 passes live Windows Allow/Deny verification and all latest CI checks. This PR remains a draft; no merge or draft promotion was performed.

When Antigravity asks permission to run a command, Chat can look busy forever because the question is hidden in the terminal. This change recognizes the real command menu and shows the existing Allow/Deny card in Chat.

What Changed

The execution host reads the current terminal screen and publishes the pending approval through the existing agent-status store. An unchanged approval is coalesced. Captured working screens clear an accepted approval to working; cancellation clears the pending tool and returns to idle once the current screen proves the empty composer is back. Native-hook rows use the runtime’s verified terminal binding, since hook payloads do not carry a terminal handle. The update requires the same terminal and status revision, and rejects outdated snapshots or lost host contact. Desktop and headless hosts use the same path.

Why

Antigravity emits a pre-tool hook even for already-allowed commands, so treating every tool start as an approval would be wrong. The new rule is based on raw captures of pending approval, Escape cancellation, one-time acceptance with 1, foreground generation, and an approved Windows background command still running. Publishing at the host keeps Chat and status readers on the same source.

Linked Issue

Follow-up to #21660 and #20157. Stacked on #21770. Does not close the overall migration issue #17345.

Visual Proof

Before: actual Windows Chat approval gap.

Before: Chat showed only the composer while the terminal waited for command approval.

Before: hidden approval

After: the real Windows Chat view shows the existing Allow/Deny card and the sidebar reports Needs permission.

After: actionable approval

At 646935991b6, clicking Allow for an eight-second command clears canonical waiting status and the sidebar’s Needs permission state within 204 ms. The card disappears immediately, status remains working during execution, and the exact final reply appears with Done at 14.3 seconds. Before this follow-up, waiting remained stale for 9.3 seconds. On the same final build, clicking Deny interrupts a second command, removes the approval and pending tool, and returns the sidebar to idle. The actual terminal confirms Interrupted and an empty composer.

Actual Windows status before Allow, during execution, and after completion

Testing

  • 67 focused and neighboring runtime/hook tests pass on macOS, including raw Windows transcript replay into the canonical host store, cancellation, stale revisions, terminal replacement, direct-SSH refusal and read coalescing.
  • Full pnpm tc, changed-code quality, focused lint, secret scans and commit hooks pass.
  • Actual native Windows agy 1.2.7 captures confirm the pending menu, Escape cancellation and one-time 1 acceptance.
  • 20 focused cases pass on macOS and natively on Windows at 646935991b6; clean Windows Electron/Vite build passes. The final follow-up also passes Node typecheck and changed-code quality.
  • Actual Windows Chat approval card, one-time Allow and Deny interaction verified; final-head cancellation returns idle; delayed acceptance clears waiting in 204 ms.

Review

Direct SSH remains terminal-only; a client does not publish screen-inferred state for an SSH mirror. Paired runtimes run the producer on their execution host. No wire opcode, required wire field, polling interval, renderer status store or automatic approval is added. Existing mobile presence-lock and send behavior remain in place. Folder workspaces use the same pane/terminal identities.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer source copied.

Notes

Remaining platform coverage: narrower terminal widths, live WSL and paired-runtime Chat. Direct-SSH Chat remains unsupported. All latest final-head CI checks pass, including all eight test shards, static analysis, typecheck, managed hooks, and macOS/Windows packaging. Temporary Windows verification app and terminal are closed; all 18 global hook files and the original hook configuration are unchanged. The generic approval card's 1 key is verified only against native Windows agy 1.2.7. This PR does not implement multi-account support or direct-SSH Chat.

Checklist

  • Explained the user-facing change, mechanism and choice of approach.
  • Automated regressions and static checks pass.
  • Rendered before/after verification complete.

@nwparker

Copy link
Copy Markdown
Contributor Author

Live Windows verification at 634ca8fc49ab23a4e8ccbb6a67822e1ff79f0fbf: still failing; keep draft / do not merge.

The exact rebuilt app accepted a prompt through Chat and agy reached the command approval menu, but Chat still showed no card. The canonical row remained working, with a real terminal handle and hook observation. terminal read --screen returned the actual menu and the committed screen matcher recognizes those rows; the live readiness wait nevertheless timed out. I am investigating the runtime snapshot/publication boundary rather than treating the passing raw-replay tests as end-to-end proof.

No persistent command allowance was selected. The earlier 66 tests and static checks remain valid within their scope; they do not prove the live fix.

@nwparker

Copy link
Copy Markdown
Contributor Author

Independent verification update:

  • Installed agy 1.2.7 returned the exact sentinel AGY_CHAT_PERMISSION_LIVE_OK.
  • Permission-screen transcript/publisher/ingest suites: 20 passed in the focused run.
  • pnpm tc:node passed.
  • Changed-code quality passed with 0 new findings.
  • CI run 35504336345 passed typecheck, static analysis, all 8 test shards, managed hooks, verify, and both packages.

Scoped verdict: Approve with #21660, in stack order. The PR’s awin visual proof covers the real Allow/Deny card, 204 ms waiting-state clear, completion, and cancellation. WSL/paired-runtime and narrow-layout coverage remain open.

@nwparker

Copy link
Copy Markdown
Contributor Author

Independent verification (2026-09-20):

  • Permission-screen/publisher/ingest/transcript suites: 74/74 passed.
  • pnpm tc:node and pnpm tc:web passed.
  • pnpm run check:code-quality:changed origin/main passed with 0 new findings across 179 changed files.
  • Installed agy 1.2.7 authenticated exact sentinel returned AGY_PERMISSION_OK.
  • Full CI 35504336345 is green across all test shards, typecheck, static analysis, managed hooks, and macOS/Windows packages. The PR includes awin Allow/Deny visual evidence.

Verdict: approve with #21660 in stack order for command-approval publication and clearing. WSL/paired-runtime and narrow-layout coverage remain open. No merge performed.

@nwparker

Copy link
Copy Markdown
Contributor Author

ELI5 / evidence / trade-offs audit

ELI5: Orca asks for permission before a chat action that needs approval, instead of silently doing it.

Proof: Permission/transcript tests and sanitized Chat proof pass; no additional screenshot was needed for this incremental approval change.

User-facing trade-off: Users may see an extra approval prompt for protected actions.

This note scopes the claim to the evidence above; it does not claim untested remote, SSH, WSL, or vendor combinations.

@nwparker
nwparker marked this pull request as ready for review September 21, 2026 01:04
@nwparker
nwparker merged commit 85f6d81 into nwparker/agy-windows-spawn-budget Sep 21, 2026
28 checks passed
nwparker added a commit that referenced this pull request Sep 21, 2026
… 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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Command-approval screen classifier — adds isAntigravityCommandApprovalScreen, an exact match for the captured four-choice Run this command? dialog, and wires it into classifyTerminalScreenReadiness so a pending approval now reports agent-approval-prompt instead of letting tui-idle time out.
  • Host-owned permission publisher — AntigravityScreenPermissionPublisher coalesces per-PTY screen reads, gates on generation/sequence/liveness and host contact, and publishes either the detected command or a positive working/idle clear.
  • Store ingest — AgentHookServer.ingestAntigravityScreenPermission rejects late revisions, other terminals and providers, restored rows, and direct-SSH rows, then writes the existing approval envelope through applyNormalizedStatus as a process observation; both the desktop and headless hosts wire the new dependency.
  • Evidence and tests — four native Windows agy 1.2.7 transcript captures with sidecars, plus unit tests covering publication, coalescing, terminal/SSH/dead-revision rejection, and the readiness classification of each capture.

I verified the new and neighboring Antigravity suites (32 tests) pass, pnpm run typecheck:node is clean, and oxlint reports no issues on the new/changed files. The changed-code quality gate could not run because its merge-base step targets origin/main while this PR is stacked on nwparker/agy-windows-spawn-budget.

Noting for the record, not as a blocker: the screen rule is an exact-string match against a single 120×40 native Windows capture, so narrower widths, other platforms, WSL, and paired-runtime Chat remain unverified — a CLI wording or layout change would silently stop surfacing the card. The PR body already scopes this.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

nwparker added a commit that referenced this pull request Sep 21, 2026
* 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
nwparker added a commit that referenced this pull request Oct 2, 2026
Recover scoped transcript, terminal approvals, and WSL support on current main.
Keep hook-server authority, captured-grid rules, quiescence, and current journals.
Negotiate Antigravity reads and subscriptions on desktop, web, and mobile.

Credits #15773, #21660, #21776, and #24141.

Co-authored-by: haoliangli <haoliangli@users.noreply.github.com>
Co-authored-by: sojiro-o <53679703+sojiro-o@users.noreply.github.com>
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.

1 participant