Repository navigation
[Fix] Invalid inference-provider keys pass save-time validation - #3673
Open
roomote-roomote[bot] wants to merge 1 commit into
Open
roomote-roomote[bot] wants to merge 1 commit into
roomote-roomote[bot] wants to merge 1 commit into
Conversation
Contributor
|
No code issues found. See session Reviewed all three changed files, classifier precedence, the pre-save guard, and retry callers. Lint, type checks, Knip, CodeQL, and the app build passed for this commit; the CI test job is still running. The native-helper regression is opt-in and skipped in ordinary CI; repository suites were not rerun during this review. Reviewed 2c07caa |
roomote-roomote
Bot
requested review from
brunobergher,
daniel-lxs and
mrubens
as code owners
November 5, 2026 06:50
This branch has not been deployed
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.
Related issue
No linked issue; internal Roomote provider-validation work.
Why this PR exists
The real inference SDK marks HTTP401/403 credential rejections as non-retryable. The shared classifier returned generic
provider_errorbefore reaching its credential classification, so the pre-save guard allowed a provider key that had just been rejected. Existing structured-status tests omitted the SDK's retry flag.What changed
Preserve
invalid_credentialsfor structured401/403 before the generic non-retryable fallback, so Models/setup rejects a known-bad key. Reuse the existing classification branch, retaining content-filter/credits precedence and excluding detected HTML gateway403 responses. Other explicit no-retry behavior, model failures and credits warnings remain as before. No UI, schema or dependency changes.Added realistic flagged-error regressions and an opt-in native-helper regression for the actual static-provider pre-save guard. Known auth failures also retain their existing terminal handling rather than being mistaken for generic rejections eligible for a fresh-session retry.
How it was tested
57aa1a2e, both new401/403 classifier cases fail, and both native pre-save guard cases resolvenullinstead of rejecting. The402 credits control passes.invalid_credentials, exactly onePOST /messages;402 returns the existing non-blocking credits warning. Run withROOMOTE_TEST_OPENCODE_PROVIDER_VALIDATION=1 pnpm exec dotenvx run --quiet -f .env.test -- pnpm --filter @roomote/web exec vitest run --project server src/trpc/commands/task-models/provider-validation.native.test.ts.Proof limits: native-helper cases are explicitly opt-in and skipped in ordinary CI. The fixture uses synthetic credentials and controlled local HTTP failures; it does not persist keys, execute a browser save, or establish live-provider parity. No paid inference, production changes or external messages. Browser proof is not applicable to this backend classification change.
The classifier boundary is separate from the safety-lifecycle refactor in #3659, which touches the same file but leaves this error classification unchanged.
Checklist
[Fix],[Feat],[Improve],[Refactor],[Docs], or[Chore]followed by a user-facing descriptionpnpm lintandpnpm check-typespass locally — normal fast lint/types/Knip gates passed insteadpnpm changeset— not run for this bounded validation repair