Skip to content

fix: preserve provider proxy base paths - #1499

Merged
Astro-Han merged 1 commit into
mainfrom
fix/provider-proxy-base-path
Jul 26, 2026
Merged

Astro-Han merged 1 commit into
mainfrom
fix/provider-proxy-base-path

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

  • preserve the upstream mount path in the client-visible provider auth proxy URL
  • forward the client pathname and query by substituting only the proxy authority, preventing Kimi Coding Plan from becoming /coding/v1/v1/messages
  • reject authenticated requests outside the configured provider mount before resolving the real upstream credential
  • update Harbor and Pier consumer contracts and add loopback coverage for Kimi Anthropic/OpenAI paths, trailing slashes, encoded paths, queries, and absolute-form request targets

Verification

  • PATH=/opt/homebrew/opt/node@22/bin:/opt/homebrew/bin:/usr/bin:/bin npm --workspace @maka/headless test — 1338 passed, 0 failed, 4 skipped
  • npm run format:check
  • npm run lint
  • npm run typecheck
  • no real provider or paid model requests were run

Root cause

The proxy advertised only its origin, so provider SDKs normalized and appended paths without seeing the upstream mount. The proxy then prefixed the upstream pathname again. That split path ownership between the client and proxy and produced doubled version segments for Kimi Coding Plan.

The new contract keeps path joining with the client: the proxy advertises the upstream pathname and replaces only the authority when forwarding. A mount-boundary check preserves the credential scope that the old prefixing behavior provided implicitly.

@Astro-Han
Astro-Han merged commit 8fa3abb into main Jul 26, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the fix/provider-proxy-base-path branch July 26, 2026 02:53
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.

1 participant