Skip to content

feat: show Antigravity terminal sessions in Chat UI - #21660

Merged
nwparker merged 2 commits into
nwparker/agy-continuation-readinessfrom
nwparker/agy-native-chat
Sep 21, 2026
Merged

nwparker merged 2 commits into
nwparker/agy-continuation-readinessfrom
nwparker/agy-native-chat

Conversation

@nwparker

@nwparker nwparker commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Latest verification — 2026-09-20: Merge verdict: approve only together with #21776, in stack order. Native Windows real hooks attach the transcript; Chat composer generation, tool completion, and the actual Allow/Deny controls pass on combined head 646935991b6. The follow-up fixes the previous invisible approval and stale waiting after acceptance: Needs permission clears within 204 ms during an eight-second command, then completion renders Done. Deny interrupts and returns idle. Both PR heads have successful latest CI checks. Direct SSH remains terminal-only; live WSL and paired-runtime Chat are still unverified. Earlier screenshots and notes below describe their original runs. No merge or draft promotion was performed.

Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​304 $\color{#cf222e}{\Huge{\mathbf{−}}}$​36 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​268
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​319 $\color{#cf222e}{\Huge{\mathbf{−}}}$​20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​299

ELI5

Antigravity conversations can now open in Orca's experimental Chat UI. Orca reads the conversation agy saved and sends composer input to the same terminal.

What Changed

Adds Antigravity to the supported-agent list and opt-in default-chat flow. One decoder feeds full reads, live tails, and journal imports. It preserves real planner text, tool_calls.args, and tool-specific MODEL results. Hook-reported transcript paths are retained; exact host/WSL path rules remain in force. Direct SSH panes stay in the terminal because that route has no native-chat transcript transport; an absolute remote path must never be opened on the client. Local and paired-runtime panes remain eligible. Older paired hosts receive an explicit update error via the new native-chat.antigravity.v1 capability check.

Why

Takes over #15773 with its author credited. Running that candidate against five real saved transcript samples dropped all 309 tool/activity records and marked intermediate planner responses as completed turns. This implementation preserves those records and leaves completion with the existing host-owned status system. A planner step marked DONE is not a completed user turn.

This adds terminal-backed chat, not an Antigravity structured-session provider. Cursor support is outside this PR.

Linked Issue

Refs #20157; takes over #15773. Stacked on #21657.

Visual Proof

Before: Antigravity's terminal view, captured during the preceding continuation verification. Paths/account details are masked.

Antigravity terminal

After: actual saved agy conversation in Chat UI, followed by a message sent through its composer and persisted by agy. Gray blocks redact private paths. Pane/session metadata was seeded because hooks were disabled in the isolated validation profile.

agy-native-chat-real.png

Tool rendering: cropped sanitized transcript fixture, not successful live model output. Shows the recorded tool-argument/result shape and subsequent assistant response.

agy-native-chat-fixture-crop.png

Testing

  • Manually tested locally in a hidden macOS renderer with installed agy 1.2.7: opened Chat UI, read an existing real transcript, sent a harmless prompt, and confirmed its marker in the saved USER_INPUT record. Returned to the original six tabs and restored temporary settings.
  • Automated tests added/updated: 139 focused tests pass; earlier resolver/lifecycle coverage also passed. Covers recorded-schema parsing, read/tail parity, path-shaped ID rejection, WSL host isolation, old-host errors, transient probe failures, cancellation, and existing-agent transport behavior.
  • Full pnpm tc, changed-code quality, commit hooks, and Electron/Vite build passed.
  • Offline real-transcript check: all 309 activity records decoded across five bounded samples; no raw private transcript content published.

Review

Live native Windows generation, hooks and Chat rendering pass; command-permission visibility and Allow/Deny status are verified with required follow-up #21776. Linux/WSL and paired-runtime Chat remain unverified. See latest verification above. The host-version boundary is tested with mocks. Follow-up 8bcb02cddef adds two direct-SSH regressions that failed before the host-readability gate; 80 related launch/availability tests, full typecheck, and changed-code quality pass. Direct SSH chat support itself remains unfinished. This PR remains draft; the scoped merge recommendation requires #21776 and does not claim live Linux/WSL or paired-runtime coverage.

The UI probe initially injected an incomplete status fixture and triggered the error boundary; the malformed fixture was removed and the valid-metadata run succeeded. No diagnostic report was sent. This is not claimed as a production crash fix.

Agent skill upstream boundary

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

Checklist

  • Explained the before/after, mechanism, and choice of approach.
  • Visual evidence distinguishes actual agy input from fixture rendering.
  • Reviewed host ownership, path handling, and mixed-version behavior.
  • Full platform/live-status verification complete.
  • Latest CI checks green at both scoped PR heads.

@nwparker

Copy link
Copy Markdown
Contributor Author

Verification update, 2026-09-20 — merge verdict: hold.

On the exact stack head b4e4c264e95, native Windows agy 1.2.7 emitted real hooks into an isolated Orca profile. Orca attached the actual provider conversation/transcript without seeded metadata. A prompt sent through the Chat composer received ORCA_WINDOWS_CHAT_ROUNDTRIP_OK, rendered in Chat.

A real run_command turn exposed a blocking UX gap: the terminal waited at “Run this command?” while Chat showed the tool row but no approval notice, and host status remained working. Switching to the terminal and approving option 1 once allowed the turn to finish; Chat rendered ORCA_WINDOWS_TOOL_DONE. No persistent command allowance was selected. The crop below proves the rendered completion after terminal approval; it does not prove approval support in Chat or expansion of the tool result.

Rendered native Windows completion

Do not promote this PR until waiting-for-permission is visible and actionable, with raw PTY capture evidence for any new terminal-screen rule and status owned by the host hook store. Direct SSH remains terminal-only by design. WSL authentication and paired Chat remain unverified. Current CI is green, which does not resolve this finding.

The owned Chat terminal/app were closed. Hook script before/after snapshots match and the original global hook config is unchanged; no credential settings were rewritten.

@nwparker

Copy link
Copy Markdown
Contributor Author

Independent verification update:

  • Installed agy 1.2.7 returned the exact sentinel AGY_NATIVE_CHAT_LIVE_OK.
  • Antigravity transcript decoder/reader/capability suites: 68 passed.
  • pnpm tc:node and pnpm tc:web passed.
  • Changed-code quality passed with 0 new findings.
  • CI run 35441542856 passed typecheck, static analysis, all 8 test shards, wire compatibility, verify, and both packages.

Scoped verdict: Approve only together with #21776, in stack order, for the verified macOS/native and Windows-backed Chat paths. WSL, paired-runtime Chat, and direct SSH Chat remain unverified or intentionally unsupported.

@nwparker

Copy link
Copy Markdown
Contributor Author

Independent verification (2026-09-20):

  • Native Chat transcript/reader/capability suites: 75/75 passed; readiness/continuation suites: 72 passed, 10 skipped.
  • pnpm tc:node and pnpm tc:web passed.
  • pnpm run check:code-quality:changed origin/main passed with 0 new findings across 139 changed files.
  • Installed agy 1.2.7 authenticated exact sentinel returned AGY_CHAT_OK.
  • Full CI 35441542856, RPC recording/verify 35441542698, and macOS/Windows packages are green. The PR includes sanitized rendered Chat proof.

Verdict: approve only with #21776, in stack order, for the tested native Chat path. WSL/paired-runtime/direct-SSH Chat remain unverified or unsupported. No merge performed.

@nwparker

Copy link
Copy Markdown
Contributor Author

ELI5 / evidence / trade-offs audit

ELI5: Orca can start a real Antigravity chat session and keep its conversation tied to the right workspace.

Proof: Transcript/session tests, sanitized rendered Chat proof, and CI pass.

User-facing trade-off: Chat behavior depends on the installed agy version and configured authentication.

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 aa00abf into nwparker/agy-continuation-readiness Sep 21, 2026
30 checks passed
nwparker added a commit that referenced this pull request Sep 21, 2026
…21657)

* fix(antigravity): wait for host-confirmed composer before continuation paste

* feat: show Antigravity terminal sessions in Chat UI (#21660)

* feat: render Antigravity terminal sessions in native chat

Co-authored-by: haoliangli <[email protected]>

* fix: keep direct SSH Antigravity chat on its execution host

---------

Co-authored-by: haoliangli <[email protected]>

---------

Co-authored-by: haoliangli <[email protected]>

@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 critical issues — minor suggestions inline.

Reviewed changes

  • Antigravity JSONL decoder — new transcript-line-decoders-antigravity.ts maps USER_EXPLICIT/USER_INPUT (with USER_REQUEST unwrap), MODEL/PLANNER_RESPONSE (thinking, text, tool_calls[].args), and MODEL tool steps to the native-chat message model, emitting no turn lifecycle so host-owned hook status stays authoritative.
  • Read paths — the decoder is wired into the full reader, the tail reader, the legacy journal import, and the decoder barrel; full-read and tail-read parity is asserted by test.
  • Path resolution — session-file-resolver.ts derives <antigravityBrainDir|~/.gemini/antigravity-cli/brain>/<id>/.system_generated/logs/transcript.jsonl and rejects non-[A-Za-z0-9_-] ids, so a conversation id can never be a caller-supplied path.
  • Agent support and direct SSH — antigravity joins the supported-agent list and nativeChatRequiresLocalTranscript, which keeps a Model-A direct-SSH pane on the terminal; agent-session-resume.ts now retains the hook transcriptPath for host-owned reads.
  • Mixed versions — new native-chat.antigravity.v1 capability plus guardAntigravityChatTransport, which probes the owning host before read/subscribe and distinguishes RUNTIME_NATIVE_CHAT_TOO_OLD from RUNTIME_NATIVE_CHAT_READ_ERROR.

I verified the capability probe checks the same host the chosen transport reads from in all three cases (desktop local, web client paired runtime, paired runtime), and that the direct-SSH entry gates hold in steady state (the isChatViewMode early return is only consumed by chat→terminal actions). The 110 focused tests pass.

ℹ️ Real transcript shapes rest on an uncommitted offline check

Every decoder field assumption is pinned only by the synthetic fixture, whose README states the step numbers are synthetic. The PR body's "309 records decoded across five samples" comes from an offline script that is not in the repo, so the load-bearing shape assumptions are not reproducible from the repository.

Technical details
# Unpinned decoder shape assumptions

## Affected sites
- `src/main/native-chat/transcript-line-decoders-antigravity.ts:102-105` — tool output is read only from `record.content`; the sibling Grok decoder reads `content ?? output ?? result`. If a real tool step stores output elsewhere, every result row is silently dropped.
- `src/main/native-chat/transcript-line-decoders-antigravity.ts:12-21` — `TOOL_STEP_TYPES` is a closed whitelist; any real step type outside it drops its output with no fallback.
- `src/main/native-chat/transcript-line-decoders-antigravity.ts:33-37` — message id is `step_index`; the live assembler discards a same-source record on an id hit (`native-chat-session-assembler.ts`), so a real transcript that emits two records per step would lose all but the first.
- `src/main/native-chat/__fixtures__/antigravity/tool-turn.jsonl` — the only committed sample.

## Required outcome
- A committed, sanitized real-shape fixture (or a shape test) that pins the tool-result field name, the tool-step type vocabulary, and step-index uniqueness, so the "309 preserved" claim is checkable and a schema drift fails a test rather than silently dropping rows.

## Open questions for the human
- Did the five offline samples include a tool step with empty output and a step whose type is outside the current whitelist? Empty output currently produces no result row at all.

ℹ️ Nitpicks

  • docs/reference/antigravity-native-chat.md is tracked via force-add; .gitignore has no !docs/reference/antigravity-native-chat.md line, so a clean git add skips it. Optional per repo norm.
  • The decoder test's it.each exercises 7 of the 8 TOOL_STEP_TYPES; SEARCH_WEB is never asserted.
  • native-chat-antigravity-capability.ts's bare catch maps a protocol-compat block to RUNTIME_NATIVE_CHAT_READ_ERROR, whereas toRuntimeNativeChatErrorMessage maps that same error to RUNTIME_NATIVE_CHAT_TOO_OLD for other agents. Likely unreachable if an incompatible host cannot be connected to at all, so flagging only as a low-confidence inconsistency.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment on lines +45 to +48
const rawContent = extractString(record.content) ?? ''
const text = extractAntigravityUserRequest(rawContent) || rawContent
if (!text.trim()) {
return null

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.

extractAntigravityUserRequest returns null for an empty <USER_REQUEST></USER_REQUEST> body, so the || rawContent fallback emits the raw wrapper text as a user bubble with literal tags. The pre-existing AI Vault reader (consumeAntigravityRecordLine) drops those records instead. Removing the fallback matches it without losing anything: extraction already returns the whole content when there is no opener.

Suggested change
const rawContent = extractString(record.content) ?? ''
const text = extractAntigravityUserRequest(rawContent) || rawContent
if (!text.trim()) {
return null
const rawContent = extractString(record.content) ?? ''
const text = extractAntigravityUserRequest(rawContent)
if (!text) {
return null
}

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 <[email protected]>
Co-authored-by: sojiro-o <[email protected]>
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