Summary
Team-mode background retry can synthesize an invalid Antigravity Gemini model ID after a retryable subagent failure. In the observed run, a subagent failed on openai/gpt-5.4-mini, retried as google/antigravity-gemini-3-flash-preview, and immediately hit ProviderModelNotFoundError because the valid model is google/antigravity-gemini-3-flash.
Environment
- LazyCodex version: source checkout from local OMO bundle at
4.16.0
- OpenCode version:
1.17.13
- OS: macOS
- Install method: Desktop OpenCode + OMO plugin/bundle
- Relevant config: team-mode run in
/Users/napadayte/MemSys with Antigravity Gemini available and working in direct smoke tests
Repository Decision
- Target repository:
code-yeongyu/lazycodex
- Why this belongs there: the failing behavior is in OMO/OpenCode plugin-side model fallback and provider model ID transformation, not in upstream Codex core.
- LazyCodex evidence (runtime + source):
- Runtime log:
~/.local/share/opencode/log/opencode.log at 2026-07-08T23:28:57Z shows retry session creation with model.id=antigravity-gemini-3-flash-preview and immediate ProviderModelNotFoundError.
- Source:
packages/omo-opencode/src/features/background-agent/fallback-retry-handler.ts builds retry model IDs through transformModelForProvider(providerID, nextFallback.model).
- Source:
packages/model-core/src/provider-model-id-transform.ts rewrites gemini-3-flash to gemini-3-flash-preview for provider === "google" without excluding antigravity-* model IDs.
- Upstream Codex source evidence from
$LAZYCODEX_SOURCE_ROOT/openai-codex-source:
- No evidence that upstream Codex owns OMO team-mode retry logic or OMO provider-model transformation.
- The observed failure happens inside OMO package paths and depends on OMO fallback wiring.
Reproduction
- Start a team-mode run where a subagent can retry through a fallback chain that includes Google Antigravity Gemini.
- Let the initial subagent model fail with a retryable error such as
AI_APICallError: Service Unavailable.
- Observe the retry path create a replacement subagent session.
- In the failing case, OMO creates the retry session with
google/antigravity-gemini-3-flash-preview.
- The retry immediately fails with
ProviderModelNotFoundError.
Expected Behavior
When team-mode retries a subagent onto Antigravity Gemini, it should keep the valid model ID google/antigravity-gemini-3-flash instead of appending -preview.
Actual Behavior
OMO creates a retry session with google/antigravity-gemini-3-flash-preview and the prompt fails with:
ProviderModelNotFoundError: Model not found: google/antigravity-gemini-3-flash-preview. Did you mean: antigravity-gemini-3-flash, gemini-2.5-flash-preview-tts, gemini-3-flash-preview?
Evidence
- Runtime log excerpt from
~/.local/share/opencode/log/opencode.log:
2026-07-08T23:28:57.863Z subagent on openai/gpt-5.4-mini hits AI_APICallError: Service Unavailable
2026-07-08T23:28:57.887Z retry session created with model.id=antigravity-gemini-3-flash-preview model.providerID=google
2026-07-08T23:28:57.963Z share subscriber failed with ProviderModelNotFoundError
2026-07-08T23:28:57.969Z prompt_async failed with the same error
- Source evidence:
packages/omo-opencode/src/features/background-agent/fallback-retry-handler.ts
packages/delegate-core/src/model-selection.ts
packages/model-core/src/provider-model-id-transform.ts
Root Cause
Strongly evidenced root cause: OMO fallback/retry paths generate the retry model via transformModelForProvider, and the Google branch in packages/model-core/src/provider-model-id-transform.ts blindly rewrites gemini-3-flash to gemini-3-flash-preview. That transformation is valid for plain Google Gemini preview naming but invalid for Antigravity-prefixed IDs such as antigravity-gemini-3-flash, producing the nonexistent antigravity-gemini-3-flash-preview.
Three investigated hypotheses:
- Hypothesis 1: old team cleanup bug (
delete-team / ENOTEMPTY) is causing the fresh failure. Rejected: the fresh runtime failure occurs before cleanup and is a model-resolution error.
- Hypothesis 2: team-mode is failing because Codex thread tools are missing. Rejected: thread tooling is available; the observed failure is in subagent retry model selection.
- Hypothesis 3: fallback/retry incorrectly rewrites Antigravity Gemini model IDs. Supported by both runtime logs and the current transform implementation.
Proposed Fix
- In
packages/model-core/src/provider-model-id-transform.ts, skip the Google preview rewrite when the model ID starts with antigravity-.
- Add regression tests covering:
google + gemini-3-flash -> gemini-3-flash-preview
google + antigravity-gemini-3-flash -> antigravity-gemini-3-flash
- equivalent protection for
antigravity-gemini-3.1-pro if the same transform path can touch it
- Verify both delegate selection and background-agent retry paths still produce the same valid retry model.
Verification Plan
- Reproduce the original retry path and confirm no retry session is created with
antigravity-gemini-3-flash-preview.
- Confirm the replacement retry session uses
google/antigravity-gemini-3-flash.
- Regression check: plain Google Gemini fallback should still map to preview naming where that behavior is intended.
This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated
Summary
Team-mode background retry can synthesize an invalid Antigravity Gemini model ID after a retryable subagent failure. In the observed run, a subagent failed on
openai/gpt-5.4-mini, retried asgoogle/antigravity-gemini-3-flash-preview, and immediately hitProviderModelNotFoundErrorbecause the valid model isgoogle/antigravity-gemini-3-flash.Environment
4.16.01.17.13/Users/napadayte/MemSyswith Antigravity Gemini available and working in direct smoke testsRepository Decision
code-yeongyu/lazycodex~/.local/share/opencode/log/opencode.logat2026-07-08T23:28:57Zshows retry session creation withmodel.id=antigravity-gemini-3-flash-previewand immediateProviderModelNotFoundError.packages/omo-opencode/src/features/background-agent/fallback-retry-handler.tsbuilds retry model IDs throughtransformModelForProvider(providerID, nextFallback.model).packages/model-core/src/provider-model-id-transform.tsrewritesgemini-3-flashtogemini-3-flash-previewforprovider === "google"without excludingantigravity-*model IDs.$LAZYCODEX_SOURCE_ROOT/openai-codex-source:Reproduction
AI_APICallError: Service Unavailable.google/antigravity-gemini-3-flash-preview.ProviderModelNotFoundError.Expected Behavior
When team-mode retries a subagent onto Antigravity Gemini, it should keep the valid model ID
google/antigravity-gemini-3-flashinstead of appending-preview.Actual Behavior
OMO creates a retry session with
google/antigravity-gemini-3-flash-previewand the prompt fails with:ProviderModelNotFoundError: Model not found: google/antigravity-gemini-3-flash-preview. Did you mean: antigravity-gemini-3-flash, gemini-2.5-flash-preview-tts, gemini-3-flash-preview?Evidence
~/.local/share/opencode/log/opencode.log:2026-07-08T23:28:57.863Zsubagent onopenai/gpt-5.4-minihitsAI_APICallError: Service Unavailable2026-07-08T23:28:57.887Zretry session created withmodel.id=antigravity-gemini-3-flash-preview model.providerID=google2026-07-08T23:28:57.963Zshare subscriber failedwithProviderModelNotFoundError2026-07-08T23:28:57.969Zprompt_async failedwith the same errorpackages/omo-opencode/src/features/background-agent/fallback-retry-handler.tspackages/delegate-core/src/model-selection.tspackages/model-core/src/provider-model-id-transform.tsRoot Cause
Strongly evidenced root cause: OMO fallback/retry paths generate the retry model via
transformModelForProvider, and the Google branch inpackages/model-core/src/provider-model-id-transform.tsblindly rewritesgemini-3-flashtogemini-3-flash-preview. That transformation is valid for plain Google Gemini preview naming but invalid for Antigravity-prefixed IDs such asantigravity-gemini-3-flash, producing the nonexistentantigravity-gemini-3-flash-preview.Three investigated hypotheses:
delete-team/ENOTEMPTY) is causing the fresh failure. Rejected: the fresh runtime failure occurs before cleanup and is a model-resolution error.Proposed Fix
packages/model-core/src/provider-model-id-transform.ts, skip the Google preview rewrite when the model ID starts withantigravity-.google + gemini-3-flash -> gemini-3-flash-previewgoogle + antigravity-gemini-3-flash -> antigravity-gemini-3-flashantigravity-gemini-3.1-proif the same transform path can touch itVerification Plan
antigravity-gemini-3-flash-preview.google/antigravity-gemini-3-flash.This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated