#3828: fix(providers): add "field required" to failover error patterns
agents
Cluster:
Error Handling in Agent Tools
## Summary
- Adds `"field required"` to the `ERROR_PATTERNS.format` array in `src/agents/pi-embedded-helpers/errors.ts`
- Adds test case for the new error pattern
## Problem
When using the Google Antigravity provider, the API occasionally returns a `Field required` validation error. Currently, this error type does not trigger auth profile rotation or model failover, causing the request to fail without attempting other available profiles.
## Solution
By adding `"field required"` to the format error patterns, Clawdbot will now:
1. Mark the current auth profile in cooldown
2. Rotate to the next available auth profile
3. If all profiles are exhausted, fall back to the next model in `agents.defaults.model.fallbacks`
## Test plan
- [x] Added test case for `"Field required"` in `isCloudCodeAssistFormatError` test suite
- [ ] Manual testing with Google Antigravity provider
Fixes #3777
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR expands the Pi embedded helper error classification by adding the string pattern `"field required"` to the `ERROR_PATTERNS.format` list (`src/agents/pi-embedded-helpers/errors.ts`). This makes “Field required” validation errors count as CloudCodeAssist format errors, which should trigger auth-profile rotation / model failover.
A corresponding Vitest case was added to assert that `isCloudCodeAssistFormatError("Field required")` returns true (`src/agents/pi-embedded-helpers.iscloudcodeassistformaterror.test.ts`).
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge, but there is a probable TypeScript typechecking failure in the updated test file.
- The functional change is small and low-risk (a new lowercase substring match), and the test coverage addition is straightforward. However, the test file currently references an undefined `WorkspaceBootstrapFile` type (and an unused helper), which can break CI if typechecking is part of the test/build pipeline.
- src/agents/pi-embedded-helpers.iscloudcodeassistformaterror.test.ts
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#14368: fix: skip auth profile cooldown on format errors to prevent provide...
by koatora20 · 2026-02-12
76.0%
#10178: fix: trigger fallback when model resolution fails with unknown model
by Yida-Dev · 2026-02-06
76.0%
#21835: fix: apply schema cleaning for google-antigravity in normalizeToolP...
by ephraimm · 2026-02-20
75.2%
#22214: fix(tools): sanitize google-antigravity schemas for Gemini-compatib...
by Kansodata · 2026-02-20
74.1%
#4445: fix: resolve Antigravity "unsupported version" and tool_use schema ...
by harry2690 · 2026-01-30
73.7%
#15205: fix(models): normalize google-antigravity api field from google-gem...
by wboudy · 2026-02-13
73.4%
#5210: Fix Antigravity server side checks and returning Version error
by Ivorisnoob · 2026-01-31
73.2%
#9583: fix(models): allow models in agents.defaults.models even if not in ...
by hotzen100 · 2026-02-05
73.2%
#2806: [AI-Assisted] Fix: Repair tool_use/tool_result pairing for Claude o...
by Arthur742Ramos · 2026-01-27
73.2%
#7229: fix: add network error resilience to agentic loop failover
by ai-fanatic · 2026-02-02
73.1%