anomalyco / anomalyco/opencode
openai-compatible provider: chat.params reasoning effort is dropped for glm-* ids but serialized for gpt-5* ids
@rekram1-node is already working on this.
Since Sep 17, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
openai-compatible provider: chat.params reasoning effort is dropped for glm-* ids but serialized for gpt-5* ids
OpenCode version: 1.18.31
Reproduction
Use a custom OpenAI-compatible provider pointed at a local OpenAI-compatible gateway. Configure a glm-* model with reasoning enabled and declare selectable low, high, and max variants, each with its matching reasoningEffort. A chat.params hook writes output.options.reasoningEffort; send a request via an agent whose message carries variant high, then inspect an allowlisted request-body capture.
Expected: the configured reasoning level serializes as reasoning_effort.
Actual: for glm-* model ids such as glm-5.3-flash, the outgoing body contains no reasoning_effort key at all. With the same options value, gpt-5* control requests serialize reasoning_effort. GPT-5-family handling also has a hardcoded medium default transform, yielding an asymmetric model-family behavior: one configured effort is silently absent while another family gets an implicit effort and serializes effort.
The report concerns serialization behavior only; the provider is a generic local OpenAI-compatible gateway. No credentials or endpoint details are needed to reproduce it.
Please make options reasoning effort propagate consistently for generic OpenAI-compatible models, rather than dropping it for glm-* model ids while relying on GPT-5-specific heuristics and defaults.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.