Skip to content

fix(maas-provider): validate Claude custom URL strictly and surface FastAPI detail message - #1412

Merged
hibig merged 2 commits into
gpustack:mainfrom
orangedeng:custom-claude-fix
Sep 24, 2026
Merged

hibig merged 2 commits into
gpustack:mainfrom
orangedeng:custom-claude-fix

Conversation

@orangedeng

Copy link
Copy Markdown
Contributor

Copilot AI balanced review requested due to automatic review settings September 23, 2026 16:20

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces validation logic for Claude custom URLs to ensure they are absolute HTTP(S) URLs without credentials, query parameters, or fragments, and updates the global request error handler to better parse FastAPI validation errors. The review suggests simplifying the URL validation logic by reusing existing utilities and improving the robustness of the error handler to support string-based detail messages.

Comment thread src/pages/maas-provider/hooks/use-provider-required-fields.tsx Outdated
Comment thread src/request-config.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

URL validation and provider-specific FastAPI error selection remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Tightens Claude custom URL validation and improves FastAPI validation error display.

Changes:

  • Rejects credentials, queries, and fragments in Claude URLs.
  • Extracts FastAPI detail messages.
  • Adds localized validation messages.
File Review
src/​request-config.tsx FastAPI error selection can surface an unrelated provider error.
src/​pages/​maas-provider/​hooks/​use-provider-required-fields.tsx URL validation still accepts malformed absolute URLs rejected by the backend.
src/​locales/​zh-CN/​provider.ts Adds Chinese validation messages.
src/​locales/​tr-TR/​provider.ts Adds Turkish validation messages.
src/​locales/​ru-RU/​provider.ts Adds Russian validation messages.
src/​locales/​ja-JP/​provider.ts Adds Japanese validation messages.
src/​locales/​en-US/​provider.ts Adds English validation messages.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/pages/maas-provider/hooks/use-provider-required-fields.tsx Outdated
Comment thread src/request-config.tsx Outdated
@hibig
hibig merged commit 333f43c into gpustack:main Sep 24, 2026
4 checks passed
@orangedeng
orangedeng deleted the custom-claude-fix branch September 24, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants