Repository navigation
feat(mcpx/model): provider-routing guarantee + typed profile exhaustion (#1925 slice) - #16611
Merged
Merged
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
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.
Slice of #1925 — the model-layer requirements of the settled script-generate contract (
pkgs/mcpx/docs/script-generate.md§3 routing guarantee + §6 typed exhaustion), inpkgs/mcpx/internal/modelonly. Claim: #1925 (comment) (lane 1652-G).What
OpenAIProvider.Generatestripped ANY provider prefix viaModelID(req.Model)and sent the bare id to its own endpoint —anthropic/claude-sonnetreaching the openai backend was silently sent to OpenAI. The contract forbids exactly this ("never merely strip a mismatching provider prefix and send the model to another provider's endpoint… an implementation requirement, not a claim that the current single-provider resolver already enforces it"). Now: a qualified id whose prefix names a different provider is refused with the new typedErrWrongProviderbefore any request is built (a misrouted call spends nothing); a matching prefix or a bare id is served as before.configured()likewise stops stripping a mismatchedmodel.defaultprefix into a default for the wrong endpoint — a mismatched default is no default, so a call naming no model reportsErrUnavailableinstead of misrouting.generateProfileflattened every exhausted chain intoErrUnavailablevia string failures. Now the typed attempt failures are preserved: an expired overall deadline returns the deadline error (context.DeadlineExceeded), a chain that reached at least one provider returns that provider's last failure, andErrUnavailableremains only when no configured backend could be attempted. HTTP 402 still stops the chain immediately (unchanged).Tests (fake providers only — the contract's oracle)
TestOpenAIProviderRefusesMismatchedProviderPrefix— mismatched prefix refused withErrWrongProvider, fake server sees 0 hits; matching/bare/case-insensitive ids served.TestResolveMismatchedDefaultModelIsNotStripped— mismatched default →ErrUnavailable, 0 endpoint hits.TestProfileExhaustionPreservesProviderFailure— attempted chain failing with HTTP 500 returns the 500 failure, notErrUnavailable.TestProfileExhaustionDeadlineIsTimeout— overall deadline expiry wrapscontext.DeadlineExceeded, notErrUnavailable.Local pre-check (package assembled from main + this branch's files):
go vetclean, fullinternal/modelsuite green including all pre-existing tests. Verification of record: repo CI on this branch.Not in scope: the daemon handler, client transport, codegen globals, or the script surface itself — #1925 stays open as the tracker for those.
Refs #1925.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-28T23:21:21Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": null, "model": null, "lane_start_issues": [], "workspace_ref": null, "auth_subject": "archer", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.