fix(pi-coding-agent): validate subprovider model and detect SDK errors#879
Merged
fix(pi-coding-agent): validate subprovider model and detect SDK errors#879
Conversation
getModel() returns undefined when a model isn't registered for a provider, causing the SDK to silently fall back to azure-openai-responses. Now throws a clear error when the model lookup fails. Also detects stopReason "error" on the last assistant message after session.prompt(), propagating SDK errors instead of silently returning empty/echoed content as a quality failure. Closes #878 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deploying agentv with
|
| Latest commit: |
d6e4a0f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2edd261d.agentv.pages.dev |
| Branch Preview URL: | https://fix-878-pi-subprovider-error.agentv.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getModel()result: WhengetModel(subprovider, model)returnsundefined(model not in pi-ai registry for that provider), throw a clear error instead of passingundefinedtocreateAgentSessionwhich silently falls back toazure-openai-responsesstopReason: "error": Aftersession.prompt(), check if the last assistant message hasstopReason === "error"and propagate theerrorMessageas an execution error instead of silently returning empty/echoed contentCloses #878
Test plan
multi-provider-skill-trigger.EVAL.yaml --target piwithsubprovider: openrouterto verify correct routing — all requests routed throughopenrouterwithopenai/gpt-5.4, score 1.000 PASSprovider_errorexecution error instead of silent quality failure🤖 Generated with Claude Code