Skip to content

Fix Antigravity source-control model discovery and retired defaults - #21606

Merged
nwparker merged 4 commits into
mainfrom
nwparker/agy-gemini-issues
Sep 21, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/agy-gemini-issues

Conversation

@nwparker

@nwparker nwparker commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​195 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​193
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​122 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​109

ELI5

Orca was asking Antigravity for a model that no longer exists. It now reads the model names the installed CLI actually offers and uses the CLI's configured model when discovery is unavailable.

What Changed

Parse current agy models output as separate IDs and labels, skip progress/header rows, and retain the older display-name format. Replace the retired Gemini 3.5 fallback with Config default, which omits --model. Pass a requested effort only when nonempty, and let recipe model/effort arguments override generated values once. Settings suggest --effort low instead of a retired model.

Why

Pinning another Gemini version would repeat the same failure when models retire. The existing --print=<prompt> delivery fix stays intact; the remaining problem is model discovery and fallback selection. This uses the existing shared planner for local and remote generation.

Linked Issue

Refs #18567. Related overlapping work: #18138 and #14157. This draft does not close or supersede those PRs yet.

Visual Proof

Hidden Electron build, identity verified as this worktree. Selected Antigravity through the rendered source-control recipe picker and inspected the screenshot. This proves the settings state; it does not prove successful text generation.

Antigravity source-control settings

Testing

  • Manually tested installed agy on macOS and the hidden Orca build. Real discovery returned 11 correctly parsed models through Orca's IPC. The retired Gemini 3.5 argument reproduces the model-selection error; omitting it reaches generation.
  • 111 focused shared tests, 19 settings tests, 35 remote-generation client tests, and 10 cross-version terminal wire tests pass, including all three source-control operations with local and SSH host selection, missing discovery, saved retired models, and recipe overrides.
  • pnpm tc (node, CLI, renderer), focused lint, and the changed-code quality gate pass.

Authenticated verification (2026-09-20): all three real macOS and native Windows source-control generation paths now succeed with installed agy 1.2.7 and configured model default: commit message, branch slug, and parsed PR fields. The probe used synthetic README context and published nothing. All CI checks pass. Direct SSH source-control generation remains untested.

The old error prints --effort "" even when no effort argument was passed; it is diagnostic output, not evidence of an empty argv value.

Review

Agent skill upstream boundary

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

Notes

No wire format or credential handling changes. The configured-model behavior advertises git.antigravity-configured-model.v1; newer clients refuse that selection on older servers with an update-or-select-an-explicit-model message. Explicit models, including recipe CLI overrides, remain usable without the new capability. The shared planner continues to run on the execution host. Provider-specific behavior is confined to the Antigravity spec and parser.

Checklist

  • Focused source-control change
  • User-facing before/after, mechanism, and rationale explained
  • Rendered settings screenshot attached with its limits stated
  • Self-reviewed; local, SSH, and older CLI output considered
  • Authenticated local generation and CI checks complete

@nwparker

nwparker commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Authenticated follow-up, 2026-09-20: bundled the exact branch source-control module and ran its real local subprocess path with installed agy 1.2.7 and model default, using only synthetic README context. All three operations succeeded:

Operation Actual result
Commit message Update title in README to verification example
Branch name update-readme-title
PR fields Parsed title “Update example README title” and a nonempty description

Live model discovery also ran. These are actual generated outputs, not mocks. The probe did not create a commit, rename a branch, or publish a PR. This closes the previous authenticated-generation gap; Windows now also passes all three operations through the same exact-branch module and real subprocess path, using the Windows process API key. The returned branch slug was update-example-readme-title; commit text and PR fields were nonempty and parsed successfully. Direct SSH source-control generation remains untested.

@nwparker

Copy link
Copy Markdown
Contributor Author

Verification update (2026-09-20):

  • Focused source-control/model tests: 59 passed across 3 files.
  • pnpm tc:web and pnpm tc:node: passed.
  • Changed-code quality gate: 0 new findings across 10 changed files.
  • Installed agy 1.2.7 authenticated sentinel: AGY_AUTH_OK.
  • Existing PR CI is green, including package, Windows package, relay integration, and cross-version wire checks.

Merge verdict: Approve in stack order for local macOS and native Windows source-control generation with the configured-model fallback. The PR's authenticated commit-message, branch-slug, and PR-field probes support those paths. Direct SSH/WSL/paired-host generation and every vendor/model combination remain unverified; keep the draft status until those are covered.

@nwparker

Copy link
Copy Markdown
Contributor Author

ELI5 / evidence / trade-offs audit

ELI5: Orca can ask agy for a commit message, branch name, and pull-request fields and then parse the answers safely.

Proof: Real local macOS/Windows subprocess probes plus focused tests and CI pass; no UI screenshot is applicable to this source-control backend.

User-facing trade-off: SSH and every vendor/model combination remain unverified.

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 04:01
@coderabbitai

coderabbitai Bot commented Sep 21, 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 →

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: cdd1bf46-7ec7-4e4a-a60a-b34a23dd09c0

📥 Commits

Reviewing files that changed from the base of the PR and between cae60da and fad5357.

📒 Files selected for processing (5)
  • src/main/runtime/rpc/methods/git-commit-message-generation-methods.ts
  • src/main/runtime/runtime-git-generation-context.ts
  • src/renderer/src/runtime/runtime-git-client-context.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/shared/rpc-contract/git-params.ts

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


📝 Walkthrough

Walkthrough

Antigravity now uses default as its configured model and builds --model and --effort arguments conditionally. Model discovery validates tab-separated and legacy formats. Remote commit-message and pull-request generation checks the configured-model runtime capability before issuing RPCs. Unsupported default-model requests return an error, while supported environments and explicit models proceed. Tests cover model resolution, argument construction, parsing, and compatibility paths.

Priority: ➖ Normal

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 9 functions across 14 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing Antigravity source-control model discovery and replacing retired defaults.
Description check ✅ Passed The description is complete and directly addresses the required sections. It explains the user impact, implementation, rationale, linked issue, visual evidence, testing, compatibility considerations, …
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟠 Major · Forward defaultTuiAgent through remote generation. · runtime-git-client-context.ts:82-100

src/renderer/src/runtime/runtime-git-client-context.ts:82-100
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Forward defaultTuiAgent through remote generation.

getRuntimeCommitMessageSettings omits defaultTuiAgent, while the compatibility check uses it. Add it to the returned settings and propagate it through both Git RPC schemas and the RPC handler. Otherwise, the remote runtime can resolve a different inherited agent or fail to resolve one.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ac559a98-1e73-4403-b9b7-94f8c5205127

📥 Commits

Reviewing files that changed from the base of the PR and between 6a7d86e and cae60da.

📒 Files selected for processing (10)
  • src/renderer/src/components/settings/source-control-action-recipe-options.ts
  • src/renderer/src/runtime/antigravity-generation-compatibility.test.ts
  • src/renderer/src/runtime/antigravity-generation-compatibility.ts
  • src/renderer/src/runtime/runtime-git-client-context.ts
  • src/renderer/src/runtime/runtime-git-generation-client.ts
  • src/shared/antigravity-source-control.test.ts
  • src/shared/commit-message-agent-spec.test.ts
  • src/shared/commit-message-agent-specs-secondary.ts
  • src/shared/commit-message-model-parsers.ts
  • src/shared/protocol-version.ts

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

}
const planned = planCommitMessageGeneration(params, '')
// A recipe or command override can already supply a model that older planners understand.
if (planned.ok && hasFlag(planned.plan.args, ['--model'])) {

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 | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 12 \
  '\b(planAdditionalAgentArgs|applySingletonOptionOverrides|agentArgOptionTokens)\b' \
  --type=ts .

Repository: stablyai/orca

Length of output: 13360


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- compatibility file ---'
sed -n '1,180p' src/renderer/src/runtime/antigravity-generation-compatibility.ts

printf '%s\n' '--- tokenizer and plan definitions ---'
rg -n -C 10 'function tokenizeCustomCommandTemplate|export function tokenizeCustomCommandTemplate|function planAdditionalAgentArgs|export function planAgentCommand|type .*Plan|default' src/shared/commit-message-plan.ts src/shared -g '*.ts'

printf '%s\n' '--- relevant call sites and tests ---'
rg -n -C 8 'antigravity-generation-compatibility|planAgentCommand|agentArgs.*model|--model.*effort|capability' src/renderer src/shared -g '*.ts' -g '*.tsx'

Repository: stablyai/orca

Length of output: 45536


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- compatibility file ---'
nl -ba src/renderer/src/runtime/antigravity-generation-compatibility.ts | sed -n '1,140p'

printf '%s\n' '--- commit-message plan top and relevant ranges ---'
rg -n 'tokenizeCustomCommandTemplate|planAdditionalAgentArgs|insertAdditionalAgentArgs|export function plan|default' src/shared/commit-message-plan.ts
nl -ba src/shared/commit-message-plan.ts | sed -n '1,110p'
nl -ba src/shared/commit-message-plan.ts | sed -n '230,340p'

printf '%s\n' '--- tokenizer declaration and implementation ---'
rg -n -l 'tokenizeCustomCommandTemplate' src/shared --glob '*.ts' | xargs -r -n1 sh -c 'echo "--- $0"; rg -n -C 20 "tokenizeCustomCommandTemplate" "$0"'

Repository: stablyai/orca

Length of output: 30449


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- singleton override flow ---'
nl -ba src/shared/commit-message-plan.ts | sed -n '105,235p'

printf '%s\n' '--- Antigravity specs and model argument construction ---'
rg -n -C 12 "antigravity|ANTIGRAVITY|configured model|model.*default" src/shared/commit-message-agent-spec.ts src/shared src/renderer/src/runtime --glob '*.ts'

printf '%s\n' '--- focused plan and compatibility tests ---'
rg -n -C 10 "planCommitMessageGeneration|antigravityGenerationCompatibilityError|agentArgs|configured.*model|ANTIGRAVITY_CONFIGURED_MODEL_RUNTIME_CAPABILITY" src/shared src/renderer/src/runtime --glob '*test*.ts' --glob '*test*.tsx'

Repository: stablyai/orca

Length of output: 45545


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- singleton override flow ---'
nl -ba src/shared/commit-message-plan.ts | sed -n '105,235p'

printf '%s\n' '--- Antigravity spec locations ---'
rg -n "id: ['\"]antigravity['\"]|antigravity.*buildArgs|ANTIGRAVITY" src/shared --glob '*.ts' --glob '!*.test.ts' --glob '!*.test.tsx'

printf '%s\n' '--- compatibility tests ---'
nl -ba src/renderer/src/runtime/antigravity-generation-compatibility.test.ts | sed -n '1,220p'

Repository: stablyai/orca

Length of output: 10589


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- generation caller ---'
rg -n -C 14 'antigravityGenerationCompatibilityError|generateRuntimeCommitMessage|generateRuntimePullRequestFields|sourceControlAiResolvedParams' src/renderer/src/runtime/runtime-git-generation-client.ts src/renderer/src/runtime --glob '*.ts' --glob '!*.test.ts'

printf '%s\n' '--- Antigravity spec ---'
nl -ba src/shared/commit-message-agent-specs-secondary.ts | sed -n '190,245p'

Repository: stablyai/orca

Length of output: 42658


Require a valid --model operand before bypassing compatibility. planAdditionalAgentArgs accepts bare --model and --model --effort low, and hasFlag matches the bare token. This can skip the capability check while the remote request still carries model: 'default'. Require a non-option value after --model or a non-empty --model=... value before returning early.

Source: Learnings

@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

This PR introduces a client-side compatibility gate that resolves the inherited agent from the client's defaultTuiAgent, but that field is never forwarded to the remote runtime — the server resolves from its own settings store instead, so the gate's verdict can diverge from what the server actually runs.

Reviewed changes

  • Antigravity model parsing — parseAntigravityModels now splits the current id<TAB>label format while keeping the legacy display-name format (requires a (low|medium|high|thinking) suffix), and dedupes rows.
  • Retired default replaced by a sentinel — the bundled Gemini 3.5 list is gone; defaultModelId is default ("Config default"), buildArgs omits --model for it, and --effort is emitted only when nonempty (singletonOptions covers --effort).
  • Runtime capability gate — new antigravityGenerationCompatibilityError blocks sending default to a runtime server that does not advertise git.antigravity-configured-model.v1, with an escape when the planned argv already carries --model (recipe/command override). Wired into both runtime generation clients.
  • Settings hint — the Antigravity recipe agent-args placeholder is now --effort low.
  • Tests — new parser/buildArgs/compatibility/retired-saved-model coverage (local + SSH host keys, all three operations); focused suites pass locally.

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

@nwparker

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit's actionable remote-generation comment in commit 7aeda56aa57.

  • Forwarded defaultTuiAgent from renderer runtime settings through both Git RPC payloads and schemas.
  • Preserved it in the runtime override merge so remote generation resolves the same inherited agent as the compatibility check.
  • Added validation using the existing typed optional TUI-agent schema.

Verification: focused Vitest (66 tests) passed; pnpm tc:node and pnpm tc:web passed; commit hooks (oxlint + React doctor + formatter) passed. This prevents remote generation from selecting a different inherited agent than the client checked.

@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 defaultTuiAgent param rejects the legitimate 'blank' sentinel, so remote source-control generation fails for any user whose default agent is "blank terminal". One inline comment below.

Reviewed changes

The delta since the prior Pullfrog review (cae60da) adds the forwarding that closes the earlier gate/server mismatch, plus a test for it.

  • Forwarded the inherited agent to the runtime — defaultTuiAgent now rides on GitGenerateCommitMessage (inherited by GitGeneratePullRequestFields) and is threaded through getRuntimeCommitMessageSettings, RuntimeCommitMessageSettingsOverride, and buildCommitMessageGenerationOverride, so getRuntimeGitGenerationSettings merges the client's agent over the server store and the compatibility gate's verdict matches what the server actually runs.
  • Covered the forwarding — runtime-git-client.test.ts asserts the field reaches the git.generateCommitMessage params.

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

sourceControlAi: SourceControlAiSettings.optional(),
sourceControlAiResolvedParams: ResolvedSourceControlAiGenerationParams.optional(),
agentCmdOverrides: z.record(z.string(), z.string()).optional(),
defaultTuiAgent: OptionalTuiAgent.nullable(),

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.

GlobalSettings.defaultTuiAgent is TuiAgent | 'blank' | null, and OptionalTuiAgent rejects the 'blank' sentinel because isTuiAgent('blank') is false. The client forwards this field whenever it is defined, so a user whose default agent is "blank terminal" sends 'blank' and the server rejects the whole request before the handler runs.

Technical details
# Accept the `blank` default-agent sentinel

## Affected sites
- `src/shared/rpc-contract/git-params.ts:187` — `defaultTuiAgent: OptionalTuiAgent.nullable()`; `OptionalTuiAgent` superRefines with `isTuiAgent` (`src/shared/tui-agent-config.ts:301`), which is false for `'blank'`.
- `src/renderer/src/runtime/runtime-git-client-context.ts:107-109` — forwards `defaultTuiAgent` whenever it is defined, including `'blank'`.
- `src/shared/rpc-contract/client-settings-params.ts:85-90` — existing precedent allows `null | 'blank' | TuiAgent` on the wire for this same setting.
- `src/main/runtime/rpc/dispatcher-request-parsing.ts:21-26` — a failed parse returns `invalidArgumentResponse`.

Verified locally: `GitGenerateCommitMessage.safeParse({ worktree: 'id:wt-1', defaultTuiAgent: 'blank' }).success === false`, while `null` and `'codex'` pass.

## Required outcome
- A client whose `defaultTuiAgent` is `'blank'` must still generate remotely; the field should not make the call invalid.

## Suggested approach (optional)
- Mirror `client-settings-params.ts`: accept `null`, `'blank'`, or a `TuiAgent`; or normalize `'blank' -> null` in `getRuntimeCommitMessageSettings` before sending, since both mean "no inherited agent" to `resolveCommitMessageSettings`.

## Open questions for the human (optional)
- Should `'blank'` reach the server at all, or be normalized to `null` client-side?

@nwparker
nwparker merged commit 253f0e3 into main Sep 21, 2026
31 checks passed
@nwparker
nwparker deleted the nwparker/agy-gemini-issues branch September 21, 2026 05:12
BeamNawapat added a commit to BeamNawapat/orca that referenced this pull request Oct 2, 2026
Source Control AI pinned Codex to gpt-5.5, which Codex retires on
2026-10-14. Any path that still resolves to that slug would then break
commit-message and PR-field generation.

Follow the Antigravity precedent (stablyai#21606): add a "Config default" entry
for Codex, make it the default, and omit --model when it is selected so
`codex exec` uses the model from the user's Codex config or Codex's own
default. Explicit model choices still pass --model.

Older remote servers would still build `--model default`, so advertise
git.codex-configured-model.v1 and have clients refuse the sentinel for
servers without it, the same way Antigravity is gated. The gate now
covers both agents, and the two capabilities live in their own module
because protocol-version.ts is at the max-lines limit.

Written with AI assistance (Claude Code).

Fixes stablyai#24481
AmethystLiang added a commit that referenced this pull request Oct 3, 2026
* fix(source-control): use Codex's configured model by default

Source Control AI pinned Codex to gpt-5.5, which Codex retires on
2026-10-14. Any path that still resolves to that slug would then break
commit-message and PR-field generation.

Follow the Antigravity precedent (#21606): add a "Config default" entry
for Codex, make it the default, and omit --model when it is selected so
`codex exec` uses the model from the user's Codex config or Codex's own
default. Explicit model choices still pass --model.

Older remote servers would still build `--model default`, so advertise
git.codex-configured-model.v1 and have clients refuse the sentinel for
servers without it, the same way Antigravity is gated. The gate now
covers both agents, and the two capabilities live in their own module
because protocol-version.ts is at the max-lines limit.

Written with AI assistance (Claude Code).

Fixes #24481

* fix(source-control): honor -m, repo overrides and low effort for Codex

Review on #24495 found three gaps in the configured-model change.
The remote compatibility gate only recognized --model, so a recipe
passing Codex's -m short flag was rejected on older servers. The gate
also ignored the repository's per-operation model override that the
server applies. And moving Codex to Config default dropped the low
reasoning effort the pinned model used, which would change cost and
latency for users whose Codex config sets a higher effort.

* fix(source-control): match gate repo and model checks to the server

Repo ids can repeat across hosts, so the configured-model gate now reads
the repo row for the worktree's host instead of the first id match, the
same row the server applies. A recipe passing --model default or
-m default no longer counts as an explicit model, since an older server
still forwards that sentinel to the Codex CLI.

* fix(source-control): read only the worktree host's repo row in the gate

A worktree that names its own host must not fall back to the runtime
host's repo row, since the server applies the row for the worktree's
host. Also cover an environment id that needs URL encoding.

* fix(source-control): default Codex to GPT-5.6 Terra low

---------

Co-authored-by: Jinjing <[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