Skip to content

feat: support Antigravity as supervised worker - #21705

Merged
nwparker merged 7 commits into
stablyai:mainfrom
beattlekid:agy-supervised-worker
Sep 22, 2026
Merged

nwparker merged 7 commits into
stablyai:mainfrom
beattlekid:agy-supervised-worker

Conversation

@beattlekid

@beattlekid beattlekid commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds support for running Antigravity CLI (agy) as a supervised worker.
  • Waits until Antigravity is genuinely ready before sending the task, including when its UI redraws or starts slowly.
  • Supports Antigravity model and effort options when starting a worker.
  • Keeps user-owned terminals safe: Orca does not take ownership of, close, or recover an external Antigravity terminal as
    though it created it.
  • Adds coverage for readiness detection, worker lifecycle, launch options, transcript handling, and release behavior.

Verification

  • Focused Antigravity readiness tests: 50/50 passed
  • Node typecheck passed
  • Changed-code quality check passed with 0 findings
  • Electron build and native rebuild passed
  • Live test with Antigravity 1.2.7 passed: Orca detected readiness, delivered the prompt, observed the worker start, and
    confirmed the expected worker and live process status

Safety

  • Workspace trust prompts are detected but never answered automatically.
  • Orca never closes an external Antigravity terminal through worker-stop or worker-release.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: fcbdcec1-d849-4cf8-bb43-06edbf2c84de

📥 Commits

Reviewing files that changed from the base of the PR and between 045f1e422cda31bb17e7b0637c986dc16e60ef62 and 787255522226edb83355ca80eb33e40482db4fba.

📒 Files selected for processing (4)
  • src/main/runtime/agent-prompt-submission-runtime.test.ts
  • src/main/runtime/orca-runtime-runtime-id.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/shared/agent-session-option-catalog.ts
💤 Files with no reviewable changes (2)
  • src/main/runtime/agent-prompt-submission-runtime.test.ts
  • src/main/runtime/terminal-wait-detection.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The change adds Antigravity session options, terminal readiness detection, visible-screen probing, hook-based prompt settlement, and worker lifecycle tests. Worker helpers now forward the selected agent and validate worker-start responses. Terminal wait paths pass agent identity into readiness probes. Typecheck scripts use the project-local TypeScript binary. Existing prompt runtime tests were moved into a new hook-and-generation test file, while the former test block was removed.

Priority: ➖ Normal

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main implementation, verification, and safety points, but it does not follow the required template. It omits the required Linked Issue, Visual Proof or N/A statement, test… Rewrite the description using all template headings. Add the linked issue after “Fixes #”, provide Visual Proof or state N/A with a reason, complete Testing with manual-test and automated-test details plus tested platforms, complete AI Disc…
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 21 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding Antigravity support as a supervised worker.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the main implementation, verification, and safety points, but it does not follow the required template. It omits the required Linked Issue, Visual Proof or N/A statement, testing checklist and platform details, AI Disclosure, Review, Agent skill upstream boundary, Notes, and final Checklist.

Resolution

Rewrite the description using all template headings. Add the linked issue after “Fixes #”, provide Visual Proof or state N/A with a reason, complete Testing with manual-test and automated-test details plus tested platforms, complete AI Disclosure if applicable, address Review, Agent skill upstream boundary, Notes, and Checklist items.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: be94edc0-bb10-4f7c-a185-0c7ea0ba65a3

📥 Commits

Reviewing files that changed from the base of the PR and between b0cbb91 and 0e16953.

📒 Files selected for processing (20)
  • docs/reference/antigravity-readiness-evidence.md
  • src/main/runtime/agent-prompt-submission-runtime.test.ts
  • src/main/runtime/agent-prompt-submission-verification.test.ts
  • src/main/runtime/agent-prompt-submission-verification.ts
  • src/main/runtime/agent-transcript-pane-test-harness.ts
  • src/main/runtime/antigravity-readiness-transcripts.test.ts
  • src/main/runtime/antigravity-terminal-readiness.test.ts
  • src/main/runtime/antigravity-terminal-readiness.ts
  • src/main/runtime/orca-runtime-resolve-terminal-pane.ts
  • src/main/runtime/orca-runtime-runtime-id.ts
  • src/main/runtime/orca-runtime-start-tui-idle-visible-read-probe.ts
  • src/main/runtime/rpc/methods/orchestration/worker/antigravity-worker-lifecycle.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-release.test-support.ts
  • src/main/runtime/runtime-terminal-wait.ts
  • src/main/runtime/terminal-wait-detection.test.ts
  • src/main/runtime/terminal-wait-detection.ts
  • src/shared/agent-session-option-catalog-antigravity.ts
  • src/shared/agent-session-option-catalog.ts
  • src/shared/tui-agent-startup-session-options.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@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.

Important

Two readiness paths can still settle an Antigravity pane the wrong way: the composer veto scans the whole screen, so an ordinary idle screen whose agent response contains a numbered list is refused; and the legacy gemini-model detector is still OR'd in, so a dialog with a model row and a caret is accepted. Both are reproduced below.

Reviewed changes

  • Composer-based AGY readiness — new antigravity-terminal-readiness.ts decides readiness from the last bare > row plus a menu-marker veto; the transcript suite drops its knownDefect inversions and now asserts the intended verdict.
  • AGY visible-screen probe — runtime-terminal-wait.ts probes AGY panes regardless of a stale status and reads { screen: true }; the rendered-screen fallback becomes visibleScreenOnly.
  • AGY prompt settlement — antigravity joins isTerminalSendSettlementAgent and the hook-observed timeout set, so a PreInvocation turn settles a prompt receipt.
  • AGY worker launch preferences — new session-option catalog (--model, --effort, mid-session /effort) registered for the shared worker-start path.
  • Tests — new readiness, worker-lifecycle, and launch-preference suites; the transcript harness accepts launchAgent.

ℹ️ Launch-preference docs still name only Claude, Codex, and Cursor

Enabling supportsWorkerLaunchPreferences for antigravity makes --model/--effort valid for AGY workers, but the two user-facing descriptions were not updated, so the feature is undiscoverable and the CLI contract text is now wrong.

Technical details
# Stale launch-preference descriptions after adding the Antigravity catalog

## Affected sites
- `src/cli/specs/orchestration-worker-specs.ts:37` — "`--model` supports Claude, Codex, and Cursor opaque provider model ids".
- `skill-guides/orchestration/references/coordinator-loop.md:24-27` — "For a fresh Claude, Codex, or Cursor terminal, `--model` accepts an opaque provider model ID".
- `src/cli/bundled-skill-guides.ts` — generated copy of the guide; must be regenerated with `node config/scripts/generate-bundled-skill-guides.mjs --write` after editing the source.

## Required outcome
- The CLI spec note and the coordinator-loop reference name Antigravity (or stop enumerating agents) so the documented surface matches what `worker-start` accepts.

## Open questions for the human (optional)
- Is the AGY model id the `agy models` slug (e.g. `gemini-3.1-pro-high`) or the label form used by the commit-message spec (`Gemini 3.5 Flash (Medium)`)? The docs should say which.

ℹ️ Nitpicks

  • src/main/runtime/runtime-terminal-wait.ts:149-160 and :253-260 — the same compound probe condition is pasted at both call sites; a small shouldProbeVisibleScreen(agent, waitText, lastAgentStatus) helper would keep them in sync.
  • src/main/runtime/terminal-wait-detection.ts:103 — when the visible snapshot has no banner, lastIndexOf('antigravity cli') is -1, so this returns -1 as a ready index. It happens to fail closed, but naming the sentinel would make that intent explicit.

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

// A trailing caret also appears on trust, sign-in, model, and onboarding menus. Those panes
// must remain blocked until the menu is gone; only the latest AGY screen can establish readiness.
if (
/do you trust|sign in|select a model|collect usage|choose a theme|press enter to continue|\b[12]\.\s/.test(

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.

This veto runs over everything from the last antigravity cli banner to the end of the screen, not just the rows around the composer. A normal idle screen whose agent response contains a numbered list (1. …) is therefore refused even when the bare > composer is the last row, so a supervised AGY worker never settles and worker-start fails on timeout. Scoping the marker check to the composer's immediate rows keeps the dialog guard without the false negative.

Technical details
# AGY composer veto scans the whole screen

## Affected sites
- `src/main/runtime/antigravity-terminal-readiness.ts:49-58` — `currentScreen` starts at the last banner, so the marker regex sees agent output and scrollback.
- Repro: `isAntigravityReadyPromptSnapshot('Antigravity CLI 1.2.0\nHere is the plan:\n1. do X\n2. do Y\n>')` returns `false`; `isKnownReadyPromptPreview` on the same text also returns `false`.

## Required outcome
- A ready screen whose only marker is a bare last-row `>` must be accepted even when content above it contains numbered lines or dialog wording from an already-answered prompt.

## Suggested approach (optional)
- Anchor the menu-marker scan to the composer (`composerStart` and the lines adjacent to it) rather than `normalized.slice(contentStart)`, and back each retained marker with a captured transcript as the rest of this module does.

## Open questions for the human (optional)
- Was `\b[12]\.\s` added for a specific captured onboarding screen? No committed transcript or test exercises that alternative.

launchArgs: (value) => ['--effort', String(value)],
agentArgsOverride: (tokens) => hasFlag(tokens, ['--effort']),
removeAgentArgs: (tokens) => removeAgentArgOption(tokens, ['--effort']),
midSession: { kind: 'command', build: (value) => `/effort ${String(value)}` }

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.

--model and the launch --effort flag are documented by Google, but /effort appears in neither official Antigravity slash-command list — only third-party write-ups, one of which says the level names shift between CLI versions. If it does not exist, this mid-session apply types /effort <level> and AGY rejects it as an unknown command. Please confirm against a capture of agy's / menu, or drop midSession until there is one.

@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 — the review-fix commit lands the big items; two minor suggestions inline.

Reviewed changes

  • Removed the legacy gemini-model detector — terminal-wait-detection.ts no longer ORs the old model-row detector into findKnownReadyPromptIndex/findDismissedStartupModalIndex; both now use the composer-based findAntigravityReadyPromptIndex.
  • Narrowed the composer menu veto — dropped the \b[12]\.\s marker and added tests proving numbered agent output is ready while a model picker drawn after an older composer is not.
  • Updated launch-preference docs — coordinator-loop.md and orchestration-worker-specs.ts now name Antigravity, and the generated bundled guide was regenerated to match (generate-bundled-skill-guides.mjs --check passes).
  • Bundled an unrelated package.json tooling change — typecheck scripts now invoke node node_modules/typescript/bin/tsc.

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

Comment on lines +52 to +53
/do you trust|sign in|select a model|collect usage|choose a theme|press enter to continue/.test(
normalized.slice(contentStart)

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.

Dropping the numbered-list marker fixes the reported repro, but the veto still scans everything from the last antigravity cli banner, so the remaining markers (sign in, select a model, choose a theme, collect usage, press enter to continue) still match anywhere in the agent's own output. An idle composer after a response that mentions signing in is refused — isKnownReadyPromptPreview('Antigravity CLI 1.2.0\nYou must sign in first\n>') returns false — and a refused tui-idle wait reaches the worker as a timeout. Bounding the scan to a tail window keeps the dialog guard without reading scrollback.

Technical details
# AGY composer veto still scans the whole screen

## Affected sites
- `src/main/runtime/antigravity-terminal-readiness.ts:51-54` — `normalized.slice(contentStart)` starts at the last banner, so the marker regex sees agent output and scrollback, not just the rows around the composer.
- Repro: `isKnownReadyPromptPreview('Antigravity CLI 1.2.0\nYou must sign in first\n>')` is `false`; the composer itself is idle.

## Required outcome
- A bare last-row `>` must be accepted when the only marker wording is in the agent's earlier output, while a live trust/sign-in/model/onboarding dialog drawn over the composer still refuses readiness.

## Suggested approach (optional)
- Reuse `startOfLastLines` / `startOfLastNonBlankLines` from `./terminal-wait-tail-window` to scan a bounded tail (the way `findTerminalWaitBlockedSignal` does) instead of `normalized.slice(contentStart)`, and back each retained marker with a captured transcript as the rest of this module does.

Comment thread package.json
"typecheck:cli": "tsc --noEmit -p config/tsconfig.tc.cli.json",
"typecheck:web": "tsc --noEmit -p config/tsconfig.tc.web.json",
"typecheck:e2e": "tsc --noEmit -p config/tsconfig.e2e.json",
"typecheck:node": "node node_modules/typescript/bin/tsc --noEmit -p config/tsconfig.node.json",

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.

This changes the typecheck scripts from tsc to node node_modules/typescript/bin/tsc, which has nothing to do with the Antigravity work. It works today (bin/tsc is a #!/usr/bin/env node shim) but it's inconsistent — typecheck:tsc:cli/typecheck:tsc:web still call tsc directly — which reads like an accidental inclusion. Please split it into its own PR or revert it.

@nwparker

Copy link
Copy Markdown
Contributor

Independent verification update:

  • Installed agy 1.2.7 responded with the exact sentinel AGY_WORKER_LIVE_OK.
  • Focused supervised-worker/readiness/prompt-settlement suites: 172 passed, 10 skipped across 8 test files.
  • pnpm tc:node passed.
  • pnpm run check:code-quality:changed origin/main passed with 0 new findings.
  • Pullfrog’s latest review reports no critical issues after the follow-up commit.

Scoped verdict: Approve after a normal full CI run, for locally owned Antigravity supervised workers on the tested host. The PR still needs explicit Windows/SSH/remote validation before claiming cross-platform completion. The current PR status exposes only the Pullfrog check, so I am not treating it as fully merge-ready yet.

@nwparker

Copy link
Copy Markdown
Contributor

Independent verification (2026-09-20):

  • Focused supervised-worker/readiness tests: 7 files, 152/152 passed.
  • pnpm tc:node passed.
  • pnpm run check:code-quality:changed origin/main passed with 0 new findings across 21 changed files.
  • Installed agy 1.2.7 authenticated print probe returned the exact sentinel AGY_AUTH_OK (no response or credentials included).
  • Current PR status exposes Pullfrog success; a normal full PR CI run is not currently present for this head.

Verdict: approve the local owned-worker behavior after the normal full CI run. The authenticated CLI probe strengthens local evidence, but it does not independently prove Windows, WSL, SSH, paired-runtime, or remote worker lifecycle behavior. No merge performed.

@nwparker

Copy link
Copy Markdown
Contributor

Fresh verification update (2026-09-20):

  • Current PR head d26e23c7fc5ff2adb94676b7a73cbf292f5426b7 fetched and tested locally.
  • Focused worker/readiness/prompt-submission suite: 172 passed, 10 skipped across 8 files.
  • pnpm tc:node: passed.
  • Changed-code quality gate: 0 new findings across 21 changed files.
  • Installed agy authenticated generation probes returned exact AGY_WORKER_AUTH_OK and AGY_WORKER_GENERATION_OK markers.
  • GitHub currently reports Pullfrog success only; the normal full CI matrix is still absent.

Merge verdict: Approve after normal full CI for local owned-worker behavior. The implementation and authenticated local generation are verified at the current head. Windows/WSL/SSH/paired-host and remote worker lifecycle remain unverified.

@nwparker

Copy link
Copy Markdown
Contributor

CI verification update (2026-09-20):

I approved the pending GitHub workflow so the normal matrix could run. Run 35480212245 completed with failures:

  • static analysis failed: src/main/runtime/agent-prompt-submission-runtime.test.ts:939 exceeds the max-lines ratchet (818 lines).
  • test shard node 24 8/8 failed with eight runtime readiness/terminal assertions in terminal-creation-and-readiness-part-06.spec.ts, terminal-output-and-worker-recovery.spec.ts, terminal-output-and-worker-recovery-part-02.spec.ts, terminal-output-and-worker-recovery-part-06.spec.ts, and terminal-handles-and-agent-status-part-03.spec.ts.
  • Typecheck, packaging, compatibility, relay integration, and the other completed checks passed; verify failed because static analysis and the test job failed.

Merge verdict update: Do not merge yet. The local focused worker suite and authenticated agy probes remain useful evidence, but this current head does not pass the repository CI contract. Please split the overlong test file and investigate the readiness/terminal regressions before re-review.

@nwparker

Copy link
Copy Markdown
Contributor

Local reproduction detail: the eight shard-8 failures split into five Antigravity readiness expectations plus three unrelated legacy/Codex/SSH readiness failures. Scoping the new {screen: true}/draft projection to Antigravity locally removes the unrelated three, leaving the five intentional Antigravity cases. Those five expose a matcher contract issue around a composer before/after the model line and the later-header-without-model case; the branch must reconcile that behavior with the existing tests rather than changing tests to hide the failures.

@nwparker

Copy link
Copy Markdown
Contributor

Follow-up verification after commit 23a83c0:

  • Fixed Antigravity readiness ordering: prompt-before-model screens resolve, model-picker tails stay blocked, later headers without model evidence fail closed, and large tails avoid String#split.
  • Split agent-prompt-submission-runtime.test.ts to satisfy the max-lines ratchet without a disable.
  • Local focused suite: 1,377 passed, 1 skipped across runtime/readiness/prompt files.
  • pnpm tc:node: passed.
  • pnpm run check:code-quality:changed origin/main: passed with 0 findings.
  • Fresh authenticated agy markers from the prior verification remain valid.

The new GitHub workflow is running. One typecheck job exited before setup because the runner could not download pnpm 12.0.0 from npm (ECONNRESET); this is an infrastructure failure, not a TypeScript result. Verdict remains do not merge until the replacement workflow completes cleanly and the remaining Windows/remote gaps are reviewed.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e860f321-03b6-4f4d-82cd-b9e19a1c9397

📥 Commits

Reviewing files that changed from the base of the PR and between d26e23c and 23a83c0.

📒 Files selected for processing (4)
  • src/main/runtime/agent-prompt-submission-runtime-hook-and-generation.test.ts
  • src/main/runtime/agent-prompt-submission-runtime.test.ts
  • src/main/runtime/antigravity-terminal-readiness.ts
  • src/main/runtime/orca-runtime-start-tui-idle-visible-read-probe.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment on lines +91 to +94
if (!workspaceBeforeComposer) {
return modelAfterComposer ? null : composerStart
}
return modelBeforeComposer || modelAfterComposer ? composerStart : 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.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Description: Show all readiness expectations that depend on model rows relative to the composer.
fd -t f 'antigravity-(terminal-readiness|readiness-transcripts)\.test\.ts' -x rg -n -C 4 'model|composer|workspace|isKnownReadyPromptPreview|isAntigravityReadyPromptSnapshot' {}

Repository: stablyai/orca

Length of output: 4488


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- implementation outline ---'
ast-grep outline src/main/runtime/antigravity-terminal-readiness.ts
printf '%s\n' '--- implementation ---'
cat -n src/main/runtime/antigravity-terminal-readiness.ts
printf '%s\n' '--- related readiness files ---'
fd -t f -i 'antigravity.*(readiness|terminal).*test.*|readiness-transcripts' . -x sh -c 'echo "--- $1"; wc -l "$1"; rg -n -C 5 "workspaceBeforeComposer|modelAfterComposer|model picker|model row|composer|Gemini|Business|workspace" "$1"' sh {}

Repository: stablyai/orca

Length of output: 9754


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- readiness caller binding ---'
rg -n -C 8 "isKnownReadyPromptPreview|isAntigravityReadyPromptSnapshot|findAntigravityReadyPromptIndex" src/main/runtime
printf '%s\n' '--- focused tests ---'
cat -n src/main/runtime/antigravity-terminal-readiness.test.ts
printf '%s\n' '--- transcript fixture references ---'
rg -n -C 6 "capture: 'A'|capture: 'B'|workspaces|Gemini 3.5|Gemini 3.7|model picker" src/main/runtime docs/reference

Repository: stablyai/orca

Length of output: 50370


🤖 get_repo_knowledge executed:

get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/architecture /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings

Length of output: 47711


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- focused caller binding ---'
rg -n -C 10 "antigravity-terminal-readiness|findAntigravityReadyPromptIndex|isAntigravityReadyPromptSnapshot|function isKnownReadyPromptPreview|isKnownReadyPromptPreview" src/main/runtime/terminal-wait-detection.ts src/main/runtime/terminal-wait-detection.test.ts

Repository: stablyai/orca

Length of output: 18043


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- Antigravity dialog fixtures ---'
sed -n '280,410p' src/main/runtime/terminal-wait-detection.test.ts
printf '%s\n' '--- all model-picker references in focused files ---'
rg -n -C 8 "model picker|select a model|Selecting|model" src/main/runtime/terminal-wait-detection.test.ts src/main/runtime/antigravity-terminal-readiness.test.ts src/main/runtime/antigravity-readiness-transcripts.test.ts docs/reference/antigravity-readiness-evidence.md

Repository: stablyai/orca

Length of output: 50371


Reject a model-shaped row after the composer in both branches. findAntigravityReadyPromptIndex sets modelAfterComposer for every non-excluded row after the composer. When workspaceBeforeComposer is true, line 94 returns composerStart instead of rejecting the snapshot. The repository evidence records that a real ready screen followed by the live /model picker is accepted. The existing test covers a synthetic picker containing Select a model, which the separate text guard rejects, but it does not cover the captured picker form. Narrow isModelRow to positive provider or effort-label evidence and apply the same post-composer rejection regardless of workspaceBeforeComposer.

@nwparker

Copy link
Copy Markdown
Contributor

Follow-up: the replacement CI run exposed one real transcript regression in shard 2: capture D (model picker dismissed) ended with Antigravity's Resume with -c footer, which the matcher had classified as a model row. The matcher now ignores that footer while continuing to reject actual model-picker rows.

Local verification after 045f1e422cda:

  • 1,397 passed, 11 skipped across runtime/readiness/transcript/prompt suites.
  • pnpm tc:node passed.
  • pnpm run check:code-quality:changed origin/main passed.
  • git diff --check passed.

The PR remains do-not-merge until the new GitHub run completes cleanly.

@nwparker

Copy link
Copy Markdown
Contributor

Final verification update for 045f1e422cda:

  • Fresh full CI run 35524718252 is green: static analysis, typecheck, all eight Node 24 shards, Linux/Windows packages, native smoke, wire compatibility, and verify.
  • Local focused suite: 1,397 passed, 11 skipped.
  • pnpm tc:node, changed-code quality, and git diff --check pass.
  • Authenticated agy worker/generation markers remain verified from the earlier live run.

Scoped verdict: approve for the exercised native macOS/Windows supervised-worker lifecycle in stack order. Remote/SSH/WSL/paired-host worker behavior remains outside this PR’s evidence, so this does not establish full migration completion. An older duplicate verify job was cancelled after the fresh verify passed; its cancelled status is superseded by the green run above.

@nwparker

Copy link
Copy Markdown
Contributor

ELI5: Antigravity can show the typing prompt before it redraws the model row, and it can leave a Resume with -c footer after a completed turn. The matcher now waits for the actual > composer, ignores that footer, and still refuses real model-picker screens. This prevents Orca from typing into setup screens while allowing normal prompts through.

No visual-proof attachment was added for this patch because it changes runtime matching and test fixtures only; it does not change a renderer/UI surface. Native macOS/Windows smoke and the full CI verify job are green.

@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.

Caution

The reworked composer detector refuses the screen captured immediately after Antigravity's /model picker is dismissed, so a supervised worker parked on that screen never settles and worker-start times out. antigravity-readiness-transcripts fails capture D at this commit; reverting only antigravity-terminal-readiness.ts to d26e23c makes it pass.

Reviewed changes

  • Reworked the composer detector — findAntigravityComposerIndex now classifies rows with a new isModelRow predicate and tracks rows before/after the last > composer, dropping the old resume with -c / agy --conversation suffix acceptance.
  • Scoped the visible-screen probe's screen read to Antigravity — startTuiIdleVisibleReadProbe passes { screen: true } and folds the draft line into the snapshot only for AGY panes, restoring base-main behavior for every other agent.
  • Split the prompt-submission runtime suite — the hook-only and PTY-generation cases moved into agent-prompt-submission-runtime-hook-and-generation.test.ts; both suites pass (38 tests).

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

@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 findings in this commit — it lands the fix for the run-3 regression. Earlier open threads are unchanged and left to the author.

Reviewed changes

  • Excluded the Antigravity resume footer from the model-row gate — isModelRow now treats lines matching /^resume with -c|^agy --conversation=/i as non-model, so the composer on the just-dismissed /model screen reads ready again.

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

@nwparker

Copy link
Copy Markdown
Contributor

Fresh CI rerun 35524718252 completed with two unrelated baseline failures:

  • Node 24 shard 3: palette-match-performance.test.ts exceeded its 180ms budget (186.04ms).
  • Mobile bundle: mobile-web-app-frame-budget-sweep.test.ts received 596462 bytes where the baseline expected no frame.

Neither failing file is in this PR's diff; this head changes agy readiness/supervised-worker paths only. The agy-focused/native lifecycle evidence remains valid, but the overall CI verdict is not green until these repository-wide failures are rerun or separately resolved. No merge recommendation is upgraded from this run.

@nwparker

Copy link
Copy Markdown
Contributor

Retry result: the previously failing mobile bundle and Node 24 shard 3/8 both passed on rerun. Run 35524718252 is now fully successful (28 completed jobs, 0 failures).

The earlier palette performance and mobile frame-budget failures were transient repository-wide checks; neither file is touched by this PR. Overall CI is now green. Merge verdict remains approve scoped native lifecycle, with remote/SSH/WSL behavior outside the evidence.

@nwparker

Copy link
Copy Markdown
Contributor

Review-bot follow-up

The automated review reported description-template/docstring-coverage warnings, but no actionable code defect. The PR now has the requested ELI5, scope, platform limits, and verification evidence in the discussion. The changed functions are small predicate/scheduling paths covered by focused tests; adding boilerplate docstrings would not change behavior or improve the contract. CI, typecheck, static analysis, and the relevant runtime tests are green.

The remaining manual/remote scenarios are explicitly documented as out of scope for this PR.

@nwparker

Copy link
Copy Markdown
Contributor

Merge-state update (2026-09-21)

The native macOS/Windows verification remains green, and the review-bot warnings were addressed in the discussion. After the readiness-stack merges, GitHub reports this branch as conflicting with main; an attempted automatic rebase also hit real conflicts in the readiness evidence/tests/runtime files.

I am leaving this PR open and unmerged rather than force-resolving behavior across the newer readiness stack. The remaining action is to rebase/reconcile the branch, rerun CI, then merge the same scoped native lifecycle change.

@nwparker
nwparker force-pushed the agy-supervised-worker branch from 045f1e4 to 7872555 Compare September 21, 2026 06:09
@beattlekid
beattlekid force-pushed the agy-supervised-worker branch from 7872555 to a9f4c2e Compare September 21, 2026 12:48
Three defects each blocked `orchestration worker-start --agent antigravity
--worktree new-child` at the agent_readiness stage.

1. Readiness never fired. The composer check required the trimmed line to be
   exactly one character, but agy 1.2.7 launches in accept-edits mode and paints
   it into the caret row (`> Accept-edits mode: ...`). Widened narrowly to a bare
   `>` or `> <name> mode:`; matching any `> <text>` would make every menu dialog
   read as ready, since they all prefix their highlighted row the same way.

2. No trust artifact for agy. Added markAntigravityWorkspaceTrusted, writing
   ~/.gemini/antigravity-cli/settings.json under `trustedWorkspaces` — verified
   empirically against agy 1.2.7, and distinct from the Gemini CLI's
   trustedFolders.json, which agy does not consult. Trust is exact-path and not
   inherited by subdirectories, so each child worktree needs its own entry.

3. The orchestration path skipped the preset. Orca has two trust dispatch
   chains: the renderer's preflightAgentTrust and the main-process
   markLocalWorktreeTrusted. worker-start only takes the second, which matched
   cursor/copilot/codex and fell through for antigravity, so the trust write
   never happened while renderer-side tests passed.

Verified live end to end: the dispatch settles `succeeded` with worker_done
carrying the right task and dispatch ids, and the worktree is appended to agy's
settings with sibling keys untouched.

Known gap: remote-agent-trust-presets.ts has no antigravity branch. The SSH
artifact path is unverified, so agy over SSH still stalls at agent_readiness.
Recorded in a comment there rather than guessed at.
@LielinaH

Copy link
Copy Markdown
Contributor

I tested this branch end to end on Windows with agy 1.2.7 and hit three defects that stop every supervised worker at agent_readiness. Fixes are in beattlekid#1, which targets agy-supervised-worker directly so this stays a single PR upstream. Take it, cherry-pick it, or ignore it — whatever is easiest.

The one I'd flag even if you want to write your own fix:

Orca has two trust dispatch chains, and orchestration only uses one of them. There is the renderer's preflightAgentTrust (IPC agentTrust:markTrusted), and the main-process markLocalWorktreeTrusted in runtime-worktree-agent-startup.ts. orchestration worker-start only ever takes the second, and it matches cursor / copilot / codex with no antigravity branch. So preflightTrust: 'antigravity' clears the !preset guard and then silently does nothing.

The reason this is worth calling out: it is invisible to the unit suite. Renderer-side tests stay green while every supervised agy worker dies at agent_readiness. I only caught it from a live run.

The other two, briefly:

  • Readiness never fires on a default launch. The composer check required the trimmed line to be exactly one character, but agy 1.2.7 starts in accept-edits mode and paints it into the caret row: > Accept-edits mode: file edits auto-approved (shift+tab to cycle). PTY-captured both ways — composer is exactly > with agentMode unset, and the long line with it set. Widening has to stay narrow, since every agy dialog also prefixes its highlighted row with > .
  • No trust artifact is written. agy reads ~/.gemini/antigravity-cli/settings.json → trustedWorkspaces (not the Gemini CLI's trustedFolders.json). Trust is exact-path and not inherited, so each child worktree needs its own entry — which is why the per-worktree preflight is required, not just nice to have.

With all three applied, the dispatch settles succeeded and worker_done arrives with the right task/dispatch ids.

Separately, worth knowing but not fixed in my PR: agy's turn start rests solely on a hook row, since it emits no OSC title and is not in SYNTHETIC_AGENT_TITLE_AGENTS. A cold start overruns the flat 30s AGENT_PROMPT_EFFECT_TIMEOUT_MS while agy is still on Signing in..., so dispatches report outcome_unknown / turn_start_unobserved before settling correctly. Looks like it wants a per-agent budget in resolveAgentPromptEffectTimeoutMs.

@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.

Important

The new Antigravity trust preflight adds a type assertion that fails the repository's changed-code quality gate (pnpm run check:code-quality:changed), which is the CI step at .github/workflows/pr.yml:153. The PR description's "Changed-code quality check passed with 0 findings" no longer holds at this head. Two informational observations follow.

Reviewed changes

  • Added an Antigravity workspace-trust preflight — markAntigravityWorkspaceTrusted appends the workspace to trustedWorkspaces in ~/.gemini/antigravity-cli/settings.json, preserving sibling keys and deduping, and is wired through AgentTrustPreset, the agentTrust:markTrusted IPC handler, and the main-process markLocalWorktreeTrusted path that orchestration worker-start takes.
  • Enabled the preset for every Antigravity launch — TUI_AGENT_CONFIG.antigravity.preflightTrust = 'antigravity'; the remote/SSH branch deliberately no-ops and documents the gap.
  • Widened the composer rule — isComposerLine now accepts > <name> mode: alongside a bare >, so agy 1.2.7's accept-edits composer row reads ready.
  • Tests — new cases in agent-trust-presets.test.ts, antigravity-terminal-readiness.test.ts, and runtime-worktree-agent-startup.test.ts.

ℹ️ The widened composer rule rests on a transcribed screen, not a captured transcript

isComposerLine now establishes readiness from > <name> mode: rows, but no committed transcript fixture contains a mode: row, so antigravity-readiness-transcripts.test.ts cannot exercise the new branch. The only coverage is a hand-transcribed screen in the unit suite, while AGENTS.md requires a readiness rule to be written against a captured transcript. The test comment already acknowledges that node-pty could not be rebuilt on the author's Windows host and commits to replacing it.

Technical details
# New readiness branch is unbacked by a captured transcript

## Affected sites
- `src/main/runtime/antigravity-terminal-readiness.ts:26-28` — `isComposerLine` accepts `> <name> mode:` and gates `findAntigravityReadyPromptIndex`.
- `src/main/runtime/antigravity-terminal-readiness.test.ts:36-57` — the accept-edits case is explicitly "NOT a byte-exact PTY capture".
- `src/main/runtime/antigravity-readiness-transcripts.test.ts` — none of the eight captured `__fixtures__` files contains a `mode:` row.

## Required outcome
- The accept-edits composer row is pinned by a raw `agy` capture (protocol in `docs/reference/agent-pty-transcript-capture.md`), so the branch is validated against real CLI output rather than a remembered screen.

## Open questions for the human
- Is a raw capture expected before merge, or is the live-observed-but-not-captured evidence acceptable for this release?

ℹ️ Antigravity over SSH still has no trust preflight

markRemoteAgentWorkspaceTrusted falls through for 'antigravity', so a supervised agy worker on an SSH execution host raises its trust dialog and fails at agent_readiness. This is pre-existing behaviour and is now documented as a known gap, but the new preset makes the gap apply to every remote Antigravity launch.

Technical details
# Antigravity SSH workers have no trust preflight

## Affected sites
- `src/main/remote-agent-trust-presets.ts:30-35` — `'antigravity'` is absent from the dispatch and writes nothing.
- `src/shared/tui-agent-config.ts:181-185` — `preflightTrust: 'antigravity'` now applies to remote launches too; `markRemoteWorktreeTrusted` routes it to the no-op.

## Required outcome
- Decide whether a supervised agy worker on an SSH execution host should fail fast at worker-start with a named reason instead of reaching `agent_readiness` and failing there.

## Open questions for the human
- Is the remote preflight planned for this PR or a follow-up?

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

Comment thread src/main/agent-trust-presets.ts Resolved

@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 in the follow-up commits — the quality-gate failure flagged in the previous review is fixed, and the readiness rule change passes every captured transcript case. Earlier open threads are unchanged and left to the author.

Reviewed changes

  • Removed the flagged type assertions — markAntigravityWorkspaceTrusted now narrows trustedWorkspaces without a cast, and markCopilotFolderTrusted parses through an unknown guard that also rejects a top-level array (Object.fromEntries(Object.entries(parsed))); pnpm run check:code-quality:changed passes with 0 findings.
  • Relaxed the composer readiness gate — findAntigravityComposerIndex drops the modelBeforeComposer requirement and refuses only when a model row follows the composer with no workspace row after it, so readiness survives a transcript tail that lost its model row. The captured model-picker, command-palette, trust, and dismissed-model screens all still refuse/accept correctly.
  • Extended the preload trust API — AgentTrustApi.markTrusted and the preload bridge now accept 'antigravity', matching the renderer's preset union.

Verified at this head: agent-trust-presets, antigravity-terminal-readiness, and antigravity-readiness-transcripts suites pass (44 passed, 10 skipped); the changed-code quality gate exits 0.

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

@nwparker
nwparker merged commit eb92222 into stablyai:main Sep 22, 2026
60 of 64 checks passed
Jinwoo-H added a commit that referenced this pull request Sep 22, 2026
…ached it (#22135)

#21705 added agent-session-option-catalog-antigravity.ts to the option catalog
the session page reaches. It merged beside C2 (#22099), whose pin of 4,359 was
measured before it, so main reads one short. Measured at eb92222 and named
by diffing against the closure at 841d06a.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
hiphapis added a commit to hiphapis/orca that referenced this pull request Sep 23, 2026
references/coordinator-loop.md conflicted in the Launch preferences section this
branch rewrote. Resolved as a union: this branch's defaults policy keeps its
shape, and upstream's additions are absorbed — the expanded agent list from
stablyai#21705 and stablyai#22383 (Antigravity, Muse), the Muse override example, and the
opencode paragraph in the position upstream placed it. The final mechanics
paragraph keeps this branch's terminal-reuse clause.

src/cli/bundled-skill-guides.ts is generated and was regenerated, not resolved.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_011nnNsG3p4Do9eiyfXGr2rB
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.

3 participants