Skip to content

fix(ai-phala): require clean api base urls#844

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/phala-clean-base-url
Jul 24, 2026
Merged

fix(ai-phala): require clean api base urls#844
ralyodio merged 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/phala-clean-base-url

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • validate Phala custom baseUrl values before building the chat completions URL
  • reject invalid URLs, non-http(s) schemes, credentials, query strings, and fragments before any network request
  • keep trailing slash normalization covered while adding unsafe custom base URL cases

Why

The adapter trimmed trailing slashes, but still accepted malformed or surprising custom API bases. This change makes Phala fail early with adapter-specific configuration errors instead of sending requests to unclear destinations.

Validation

  • vitest run packages/ai/phala/src/index.test.ts (12 tests)
  • tsc -p packages/ai/phala/tsconfig.json --noEmit
  • git diff --check

Copilot AI review requested due to automatic review settings July 23, 2026 19:12

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ralyodio
ralyodio merged commit 14596a9 into profullstack:master Jul 24, 2026
4 checks passed
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