fix(#7026): add Vertex model fallback for aliased pi runs - #7027
fix(#7026): add Vertex model fallback for aliased pi runs#7027fullsend-ai-coder[bot] wants to merge 3 commits into
Conversation
When the pi runtime receives an alias request (opus, sonnet, haiku,
fable) and FallbackModels are configured, the runner now tries each
model in order. A Vertex 404 ("Publisher model not found") or 403
("data sharing not enabled") on the current model triggers the next
fallback. Pinned explicit ids (provider/id or bare catalog ids) fail
loudly with no silent fallback.
- Extract single-model execution into piExecModel to support retries
- Add isVertexModelUnavailable to detect Vertex 404/403 error shapes
- Add isPiAliasedModel / piFallbackChain to build the ordered chain
- Update metrics.Model to reflect the model that actually answered
- Remove the old "fallback models are ignored" warning
- Update docs/runtimes.md to document the new behavior
Closes #7026
|
🤖 Finished Review · ✅ Success · Started 8:28 PM UTC · Completed 8:50 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high |
Site previewPreview: https://374873ef-site.fullsend-ai.workers.dev Commit: |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsModerate risk: clean metadata profile (small file count, no protected/security paths, trusted bot author) offset by very high file churn and concentrated fix/revert history across the pi runtime area; the PR is well-scoped to the linked issue with tests, and Tier 1 signals are unchanged from prior review, preserving the anchored score of 2. Previous runRisk Assessment: moderate (2/5) DetailsModerate risk: clean metadata profile (small file count, no protected/security paths, trusted bot author) offset by very high file churn and concentrated fix/revert history across the pi runtime area; the PR is well-scoped to the linked issue with tests, and Tier 1 signals are unchanged from prior review, preserving the anchored score of 2. Previous run (2)Risk Assessment: moderate (2/5) DetailsModerate risk: clean metadata profile (small file count, no protected/security paths, good test ratio, trusted bot author) offset by high file churn and concentrated fix/revert history in the pi runtime area; the PR itself is well-scoped to the linked issue with tests. |
ReviewFindingsLow
Previous runReviewFindingsMedium
Low
Next steps:
Previous run (2)ReviewFindingsHigh
Medium
Low
Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 8:52 PM UTC · Completed 9:02 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.47 |
- Suppress ResultEvent forwarding from failed fallback attempts in piExecModel so the renderer does not show a fully-formed error block before the fallback warning; the final attempt ResultEvent is forwarded after the loop selects the successful attempt - Update docs/runtimes/pi.md At a glance table: move Fallback chains from Not supported to its own row with conditional support language - Update docs/runtimes/pi.md model-alias section to reflect that aliased models now fall back on Vertex 404/403 - Update docs/cli/run.md to say pi uses the fallback chain for aliased models instead of ignoring it with a warning - Restore four design-rationale comments removed during the refactor: hooks-predicate wired check, extension-preflight host-directory hash, sub-agent children tokens, and per_model_usage invariant Note: pre-commit hooks were not run. pre-commit could not complete (infrastructure failure: HTTP 403 fetching remote hooks), and the hooks were run directly (gofmt, go vet, trailing-whitespace, docs-links). Addresses #7027
🔧 Fix agent — iteration 1 (bot-triggered)Addressed 5 of 7 review findings with code and doc fixes. Updated three stale doc references to reflect pi's new conditional fallback support. Suppressed error ResultEvent forwarding from failed fallback attempts so users see only the final result. Restored four design-rationale comments removed during the refactor. Disagreed on two low-severity findings (ToolCalls accumulation and fallback validation) that the reviewer acknowledged are correct in practice. Fixed (5):
Disagreed (2):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 9:04 PM UTC · Completed 9:26 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.79 |
|
🤖 Finished Fix · ✅ Success · Started 9:28 PM UTC · Completed 9:34 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.43 |
…odes
Add a "Model fallback chain" bullet to the pi Process and exit codes
section in runtime-implementation.md, documenting:
(1) Run builds a piFallbackChain for aliased models from
FULLSEND_FALLBACK_MODELS
(2) Vertex 404/403 triggers retry with the next model
(3) Pinned model IDs skip the chain and fail immediately
Addresses #7027
🔧 Fix agent — iteration 2 (bot-triggered)Addressed the medium-severity stale-doc finding by adding fallback chain documentation to the Process and exit codes section. Disagreed on three low-severity findings the reviewer acknowledged are correct in practice or not a regression. Fixed (1):
Disagreed (3):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 9:36 PM UTC · Completed 9:56 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.12 |
Superseded by updated review
Summary
Implements runner-level Vertex model fallback for pi alias requests. When a model alias (opus, sonnet, haiku, fable) hits a Vertex 404 or 403, the runner retries with the next entry in
FULLSEND_FALLBACK_MODELS. Pinned explicit ids fail loudly — no silent fallback.Related Issue
Closes #7026
Changes
piExecModelto support retry loopisVertexModelUnavailableto detect Vertex 404 ("Publisher model not found") and 403 ("data sharing not enabled") error shapesisPiAliasedModel/piFallbackChainto build the ordered, deduplicated model chainmetrics.Modelto reflect the model that actually answereddocs/runtimes.mdto document the new behaviorTesting
TestIsVertexModelUnavailable— 404/403 patterns, case insensitivity, non-model errorsTestIsPiAliasedModel— documented aliases, empty model default, bare IDs, provider/id specs, config aliasesTestPiFallbackChain— alias+fallbacks chain, pinned ID (no fallback), provider/id (no fallback), empty fallbacks, deduplication, config aliasesgo vet,gofmt, secret scan all cleanCloses #7026
Post-script verification
agent/7026-pi-vertex-fallback)403540d77c8c32f89ec7e813bf68c7ff016f582e..HEAD)