Skip to content

fix: raise OpenClaw report maxTokens to 8192 to prevent mid-sentence truncation#204

Merged
litang9 merged 1 commit into
mainfrom
fix/openclaw-maxtokens
Jul 13, 2026
Merged

fix: raise OpenClaw report maxTokens to 8192 to prevent mid-sentence truncation#204
litang9 merged 1 commit into
mainfrom
fix/openclaw-maxtokens

Conversation

@litang9

@litang9 litang9 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Problem

The OpenClaw deep-dive report gets truncated mid-sentence on high-activity days (e.g. #195):

今日 OpenClaw 项目展现出极高的工程迭代效率与社区活跃度。过去

Sentence cuts off at "过去"; the comparison section even notes "由于今日 OpenClaw 的原始数据源在提取时意外截断".

Root cause

OpenClaw consumes the largest input (issues+prs+releases, often 900+ items) but calls callLlm with the **default `maxTokens=4096`` — smaller than every other report:

Report maxTokens Input
trending 6144 small
web 8192 medium
OpenClaw 4096 (default) largest

Output hits finish_reason=length mid-report and the truncated text is written to the issue.

Fix

Pass 8192 explicitly (src/index.ts), matching the web report:

- return await callLlm(buildPeerPrompt(cfg, issues, prs, releases, dateStr, 50, 30, lang));
+ return await callLlm(buildPeerPrompt(cfg, issues, prs, releases, dateStr, 50, 30, lang), 8192);

Co-Authored-By: Claude noreply@anthropic.com

The OpenClaw deep-dive report uses the largest input (issues+prs+releases,
often 900+ items) but called callLlm with the default maxTokens=4096,
which is smaller than trending (6144) and web (8192). On high-activity
days the output hit finish_reason=length mid-sentence and got written to
the issue as truncated text. Pass 8192 explicitly, matching the web report.
@litang9
litang9 merged commit 43c91e1 into main Jul 13, 2026
1 check passed
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