Skip to content

options.maxTokens in pi-ai maps to wrong API parameter for opencode-go provider #5331

@janbam

Description

@janbam

What happened?

options.maxTokens in pi-ai is silently ignored for opencode-go provider. The API accepts max_tokens but pi-ai sends max_completion_tokens, which the backend ignores.

Steps to reproduce

Send streamSimple(model, ctx, { maxTokens: 1 }) for any opencode-go model -- output is not truncated.

Expected behavior

maxTokens maps to "max_tokens", not "max_completion_tokens"

Version

0.78.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginprogressIssue is being worked on

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions