Skip to content

fix: avoid conflicting token limits in summarization requests - #312

Closed
CBOSSX wants to merge 1 commit into
AIPentest:mainfrom
CBOSSX:bugfix/summary-token-limit-20260914T061636Z
Closed

CBOSSX wants to merge 1 commit into
AIPentest:mainfrom
CBOSSX:bugfix/summary-token-limit-20260914T061636Z

Conversation

@CBOSSX

@CBOSSX CBOSSX commented Sep 14, 2026

Copy link
Copy Markdown

Closes #288.

Summary generation currently sends both max_tokens and max_completion_tokens, causing strict OpenAI-compatible endpoints to return HTTP 400. Select max_completion_tokens for OpenAI-compatible models and the common max_tokens option for native Claude/Anthropic models, so each provider receives its supported output budget.

The regression tests exercise real Eino request serialization against local HTTP fixtures for both classic and agentic paths. Both OpenAI cases fail before the fix with the reported 400 and pass afterward. Both native Claude cases retain the 4096-token summary budget instead of the model's 8192-token default. No live provider credentials are required.

Validation:

  • go test ./internal/multiagent -run '^TestEinoSummarization(SendsOneTokenLimit|PreservesClaudeTokenLimit)$' -count=1 — failing before, passing after.
  • go test ./internal/multiagent ./internal/openai ./internal/llm -count=1 — passed.
  • go test ./... — passed.
  • go vet ./internal/multiagent ./internal/openai ./internal/llm — passed.
  • gofmt and git diff --check — passed.

@CBOSSX

CBOSSX commented Sep 24, 2026

Copy link
Copy Markdown
Author

Superseded by upstream commit bbfcb87, which now selects max_completion_tokens for OpenAI-compatible summary requests and max_tokens for native Claude. I verified the current main e9b6e0d with go test ./internal/multiagent -run TestEinoSummarizationModelOptionsSetOnlyMaxCompletionTokens -count=1 (passed). Closing this duplicate rather than reintroducing the conflicting implementation.

@CBOSSX CBOSSX closed this Sep 24, 2026
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.

API Error: max_tokens and max_completion_tokens cannot be set at the same time (火山引擎/DeepSeek API)

1 participant