Skip to content

fix: pass providerType to chat api#206

Closed
ChaseAfterLight wants to merge 1 commit intoTHU-MAIC:mainfrom
ChaseAfterLight:fix/provider-type-passthrough
Closed

fix: pass providerType to chat api#206
ChaseAfterLight wants to merge 1 commit intoTHU-MAIC:mainfrom
ChaseAfterLight:fix/provider-type-passthrough

Conversation

@ChaseAfterLight
Copy link

Summary

Fixes chat requests for custom providers by passing providerType from the client to /api/chat and through server model resolution.

Related Issues

None.

Changes

  • Added providerType to the stateless chat request type.
  • Passed providerType from use-chat-sessions when sending chat requests.
  • Forwarded providerType into getModel() in /api/chat.
  • Keeps custom providers from failing with Unknown provider ... Please provide providerType.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or build changes

Verification

Steps to reproduce / test

  1. Configure a custom provider.
  2. Send a chat message through the chat session flow.
  3. Confirm the request no longer fails with Unknown provider ... Please provide providerType.

What you personally verified

  • Confirmed the code path that builds /api/chat requests now includes providerType.
  • Ran pnpm exec tsc --noEmit successfully.
  • I did not run a full browser end-to-end test in this session.

Evidence

  • CI passes (pnpm check && pnpm lint && npx tsc --noEmit)
  • Manually tested locally
  • Screenshots / recordings attached (if UI changes)

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have added/updated documentation as needed
  • My changes do not introduce new warnings

@wyuc
Copy link
Contributor

wyuc commented Mar 22, 2026

Thanks for the fix! This is covered by #114 which also threads providerType through all three call sites and refactors the chat route to use the shared resolveModel() helper. Closing as duplicate.

@wyuc wyuc closed this Mar 22, 2026
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.

2 participants