← Back to PRs

#3828: fix(providers): add "field required" to failover error patterns

by ai-fanatic open 2026-01-29 07:04 View on GitHub →
agents
## 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