Skip to content

fix(converter): 输出截断最多重试 1 次,避免按 4 倍计费 (#96) - #98

Merged
haywolf merged 2 commits into
masterfrom
fix/96-truncation-retry
Nov 5, 2026
Merged

haywolf merged 2 commits into
masterfrom
fix/96-truncation-retry

Conversation

@haywolf

@haywolf haywolf commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #96

  • 新增 OutputTruncatedError / ErrorType.TRUNCATION_ERROR,按类型(非文案)识别截断。
  • 截断按页单独计数,converter.maxTruncationRetries: 1:截断最多请求 2 次;第 1 次截断、第 2 次正常仍成功。
  • 其他错误的 maxRetries、退避和分类不变(测试覆盖 8 种错误类型)。
  • 测试:unit 1225、renderer 308、typecheck、lint、verify:package(linux-x64)均通过;撤回修复后 17 个用例失败。

截断的错误文案含 "LLM",被归为普通 LLM 错误,按 maxRetries 最多请求 4 次,
而每次都要全额付费。总是截断的页面费用变成 4 倍,最后仍然失败。

- 新增 OutputTruncatedError 和 TRUNCATION_ERROR,按类型而非文案识别,
  不会误伤图片损坏时的 "The image file is truncated"
- 新增配置 converter.maxTruncationRetries = 1,按页统计截断次数,与 attempt
  分开:其他错误既不占用也不增加这个额度,其重试次数不变
- 文案从 "Try again" 改为提示换用输出上限更高的模型
@haywolf
haywolf merged commit 70c8805 into master Nov 5, 2026
2 checks passed
@haywolf
haywolf deleted the fix/96-truncation-retry branch November 5, 2026 19:31
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.

模型输出截断时按普通错误重试 4 次,费用最坏 4 倍

1 participant