Skip to content

Stop Posit AI models from truncating long replies at 4,096 tokens - #82

Merged
wch merged 1 commit into
mainfrom
fix/positai-output-token-fallback
Aug 24, 2026
Merged

Stop Posit AI models from truncating long replies at 4,096 tokens#82
wch merged 1 commit into
mainfrom
fix/positai-output-token-fallback

Conversation

@wch

@wch wch commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

When you chat with a Posit AI model that doesn't declare its own output limit — GLM 5.2 today — a long reply cuts off mid-thought at exactly 4,096 tokens. The assistant never tells the server how much output to allow, so the server's small default applies and the response ends with a "length" stop reason.

The assistant now sends a default limit of 16,384 output tokens for every Posit AI model, matching the baseline it already uses for other providers. Models that declare their own limit, such as Kimi K3 at 131,072, keep it.

If a model is new or otherwise unknown to the assistant, the 16,384 default applies instead of the server's. No server changes are required. The new value takes effect on the next model-list refresh; cached model lists refresh within an hour.

Models without a declared output limit (GLM-5.2 today) sent no
max_tokens, so the server's 4,096 default truncated long replies.
The fetcher now applies a 16,384 fallback before the capabilities
spread, so explicit per-model entries (Kimi K3: 131,072) still win.
@wch
wch merged commit dab1fea into main Aug 24, 2026
4 checks passed
@wch
wch deleted the fix/positai-output-token-fallback branch August 24, 2026 20:21
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.

1 participant