Skip to content

[Bug]: Chat fails with "Unknown provider: custom-xxx" for custom providers #116

@nkmohit

Description

@nkmohit

Bug Description

When a custom provider is configured via the Settings UI (e.g. OpenRouter or any self-hosted endpoint), sending a message, starting a discussion, or resuming a session in the chat panel fails with a 500 error.

Steps to Reproduce

  1. Configure a custom provider in Settings (base URL + API key + model)
  2. Generate a classroom with that provider
  3. Send a message in the chat panel

Expected Behavior

Chat responds normally using the configured custom provider.

Actual Behavior

500 error: Unknown provider: custom-1773899122192. Please provide providerType.

Image Image

Deployment Method

Local development (npm run dev / pnpm dev / yarn dev)

Browser

Brave

Operating System

macOS 26.2

Relevant Logs / Screenshots

[2026-03-19T08:37:39.497Z] [ERROR] [ChatSessions] [ChatArea] Error: Error: API error: 500 - {"success":false,"errorCode":"INTERNAL_ERROR","error":"Unknown provider: custom-1773899122192. Please provide providerType."}
    at useChatSessions.useCallback[runAgentLoop] (http://localhost:3000/_next/static/chunks/Developer_OpenMAIC_components_chat_a0ed9d01._.js:871:27)
    at async useChatSessions.useCallback[sendMessage] [as sendMessage] (http://localhost:3000/_next/static/chunks/Developer_OpenMAIC_components_chat_a0ed9d01._.js:1456:17)

Additional Context

Fix available in PR #114. Root cause: /api/chat used an older manual provider resolution path that didn't forward providerType, unlike all other API routes which already used resolveModel().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions