Open
Conversation
问题: 使用 Gemini(及其他模型)时,修订/分析流程可能产生字数极少的章节 (如 3000+ 字变成 20 字)。原因是: 1. ChapterAnalyzerAgent 要求 LLM 在 CHAPTER_CONTENT 中"原样输出"章节内容 2. 部分模型(尤其是 Gemini)不会可靠地输出完整内容 3. 截断后的内容长度被用作 wordCount 解决方案: - 在 buildPersistenceOutput 中直接使用 finalContent,不再依赖 LLM 回显 - 添加字数守卫:修订后字数低于原文 50% 时拒绝修订 - spot-fix 的 maxTokens 从 8192 提升到 16384 - 强化 spot-fix 提示词,明确要求输出完整章节正文 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
使用 Gemini(及其他模型)时,修订/分析流程可能产生字数极少的章节(如 3000+ 字变成 20 字)。
复现步骤
根因分析
ChapterAnalyzerAgent要求 LLM 在CHAPTER_CONTENT中"原样输出"章节内容wordCount,覆盖了正确的值解决方案
buildPersistenceOutput中直接使用finalContent,不再依赖 LLM 回显maxTokens从 8192 提升到 16384测试
🤖 Generated with Claude Code