#18697: fix: include forward-compat models in model catalog for allowlist val…
agents
stale
size: S
Cluster:
OpenAI Model Fixes and Updates
## Summary
- **Problem:** `google-antigravity/claude-opus-4-6` shows in `/models list` but switching to it via alias or directly returns "Model is not allowed"
- **Why it matters:** Users who configure this model in their allowlist cannot use it despite it appearing as available
- **What changed:** Added [applyAntigravityForwardCompat()](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-catalog.ts:67:0-97:1) to [loadModelCatalog](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-catalog.ts:110:0-193:1) in [model-catalog.ts](cci:7://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-catalog.ts:0:0-0:0) — synthesizes `claude-opus-4-6` / `claude-opus-4-6-thinking` from `claude-opus-4-5` templates (same pattern as existing [applyOpenAICodexSparkFallback](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-catalog.ts:33:0-56:1))
- **What did NOT change:** [list.registry.ts](cci:7://file:///Users/dzmitryarabei/projects/openclaw/src/commands/models/list.registry.ts:0:0-0:0), [model-selection.ts](cci:7://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-selection.ts:0:0-0:0), [model-forward-compat.ts](cci:7://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-forward-compat.ts:0:0-0:0) — no changes to existing forward-compat or allowlist logic
## Change Type (select all)
- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Docs
- [ ] Security hardening
- [ ] Chore/infra
## Scope (select all touched areas)
- [x] Gateway / orchestration
- [ ] Skills / tool execution
- [ ] Auth / tokens
- [ ] Memory / storage
- [ ] Integrations
- [ ] API / contracts
- [ ] UI / DX
- [ ] CI/CD / infra
## Linked Issue/PR
- Related: forward-compat model catalog gap for google-antigravity models
- Also closes #16547
## User-visible / Behavior Changes
Users with `google-antigravity/claude-opus-4-6` in `agents.defaults.models` can now switch to this model without getting "Model is not allowed" error.
## Security Impact (required)
- New permissions/capabilities? [No](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-selection.ts:66:0-75:1)
- Secrets/tokens handling changed? [No](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-selection.ts:66:0-75:1)
- New/changed network calls? [No](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-selection.ts:66:0-75:1)
- Command/tool execution surface changed? [No](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-selection.ts:66:0-75:1)
- Data access scope changed? [No](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-selection.ts:66:0-75:1)
## Repro + Verification
### Environment
- OS: Ubuntu (VPS) / macOS
- Runtime/container: Node v22
- Model/provider: google-antigravity
- Integration/channel: Telegram
- Relevant config (redacted):
```json
{
"agents": {
"defaults": {
"models": {
"google-antigravity/claude-opus-4-6": { "alias": "opus" }
}
}
}
}
```
### Steps
1. Configure `google-antigravity/claude-opus-4-6` with alias "opus" in `agents.defaults.models`
2. Run `/models` — model appears in the list
3. Run `/models opus` or select claude-opus-4-6
### Expected
- Model switches to claude-opus-4-6
### Actual (before fix)
- Error: `Model "google-antigravity/claude-opus-4-6" is not allowed`
## Evidence
- [x] Failing test/log before + passing after
- [ ] Trace/log snippets
- [ ] Screenshot/recording
- [ ] Perf numbers (if relevant)
All 5 tests pass (`vitest run src/agents/model-catalog.test.ts`):
- `synthesizes google-antigravity/claude-opus-4-6 from claude-opus-4-5 template` ✅
- `does not duplicate claude-opus-4-6 when already in catalog` ✅
Tested on live VPS instance — model switching works after fix.
## Human Verification (required)
- Verified scenarios: switching to opus via alias in Telegram, `/models` listing
- Edge cases checked: no duplication when model exists natively in catalog
- What you did **not** verify: full CI pipeline (pre-existing TS errors in unrelated files `telegram.ts`, `send-api.ts` block `build:plugin-sdk:dts`)
## Compatibility / Migration
- Backward compatible? `Yes`
- Config/env changes? [No](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-selection.ts:66:0-75:1)
- Migration needed? [No](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-selection.ts:66:0-75:1)
## Failure Recovery (if this breaks)
- How to disable/revert this change quickly: revert single commit, redeploy
- Files/config to restore: [src/agents/model-catalog.ts](cci:7://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-catalog.ts:0:0-0:0)
- Known bad symptoms reviewers should watch for: duplicate model entries in catalog
## Risks and Mitigations
- Risk: When `claude-opus-4-6` is added natively to pi-ai catalog, synthesized entry becomes redundant
- Mitigation: [applyAntigravityForwardCompat](cci:1://file:///Users/dzmitryarabei/projects/openclaw/src/agents/model-catalog.ts:67:0-97:1) checks `exists` before adding — no duplicates. Synthesized entry is silently skipped when native one appears.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixes allowlist validation for `google-antigravity/claude-opus-4-6` models by synthesizing catalog entries from `claude-opus-4-5` templates in `loadModelCatalog`. This mirrors the existing forward-compat pattern used in `list.registry.ts` and follows the same duplication-prevention logic as the OpenAI Codex fallback.
<h3>Confidence Score: 5/5</h3>
- Safe to merge with no risk
- The change applies an existing, well-tested pattern (`applyOpenAICodexSparkFallback`) to a new provider. Tests confirm correct synthesis and duplication prevention. The implementation is backward-compatible and includes proper safeguards.
- No files require special attention
<sub>Last reviewed commit: 4b658b6</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#13119: fix: add forward-compat for google-antigravity claude-opus-4-6 models
by sdb001 · 2026-02-10
86.3%
#19533: fix: allow forward-compat models in buildAllowedModelSet
by Anthony-g-dev · 2026-02-17
82.2%
#6673: fix: preserve allowAny flag in createModelSelectionState for custom...
by tenor0 · 2026-02-01
81.8%
#14508: fix(models): allow forward-compat models in allowlist check
by jonisjongithub · 2026-02-12
81.7%
#20275: fix(cli): include primary model in allowlist when adding fallbacks
by MFS-code · 2026-02-18
81.6%
#9583: fix(models): allow models in agents.defaults.models even if not in ...
by hotzen100 · 2026-02-05
81.3%
#21088: fix: sessions_sspawn model override ignored for sub-agents
by Slats24 · 2026-02-19
81.2%
#21181: fix(models): add gemini-3.1-pro-preview forward-compat for google-g...
by Mellowambience · 2026-02-19
81.1%
#12220: fix: forward-compat models now respect user-configured contextWindow
by Batuhan4 · 2026-02-09
80.9%
#16687: fix(antigravity): default to Gemini 3 Pro and remove broken depreca...
by vincentkoc · 2026-02-15
80.8%