pi-ai sends unsupported OpenAI-specific request fields/roles/auth to compatible providers
Author: srcKodCreated Sep 12, 2026Updated Sep 28, 2026
Labelsbug
What happened?
pi-ai sends OpenAI-specific request fields, message roles, or auth headers that some OpenAI-compatible providers reject, causing otherwise-working providers to return 400/422 errors.
Steps to reproduce
- Configure an OpenAI-compatible provider in models.json.
- Use a model/provider that does not support one or more OpenAI-specific request fields, roles, or auth patterns.
- Observe a 400/422 response from the provider even though the provider is otherwise reachable and compatible.
Expected behavior
- Request parameters: pi-ai should omit provider-unsupported fields by default, including but not limited to store, tools, tool_choice, and similar OpenAI-specific parameters, when the provider/model does not declare support for them.
- Message roles: pi-ai should not send reasoning-oriented message roles that the target provider rejects; role selection should be conditional on provider/model capability, not inferred only from model.reasoning.
- Auth handling: when no API key is configured or the key is blank, pi-ai should allow unauthenticated requests for public providers instead of sending an invalid auth header or failing SDK credential validation.
- Config surface: provider/model compat should expose explicit flags for unsupported fields/roles so request builders can conditionally omit them.
- Durability: equivalent fixes should be applied to bundled runtime chunks so they survive pi updates.
Version
0.85.1
Source: earendil-works/pi