Skip to content

fix: restore continuation when truncated output is empty - #4

Open
xbx787 wants to merge 1 commit into
Lynn-x:mainfrom
xbx787:fix/continuation-empty-output
Open

xbx787 wants to merge 1 commit into
Lynn-x:mainfrom
xbx787:fix/continuation-empty-output

Conversation

@xbx787

@xbx787 xbx787 commented Aug 14, 2026

Copy link
Copy Markdown

What changed

  • Added an empty-output guard to callLlmWithContinuation.
  • When the initial response is truncated without visible content, retry the original task once with thinkingMode: "fast".
  • Allow bounded continuation after an empty retry result, using a dedicated prompt when there is no assistant text to prefill.
  • Preserve the existing non-empty continuation path and graceful failure behavior.

Why

Reasoning models can consume the entire max_tokens budget internally and return finishReason: "length" with empty message.content. The previous text.trim() loop guard prevented any continuation request, producing an empty final briefing. This fixes issue #2.

Fixes #2

Impact

  • Normal non-empty truncated responses keep the original options object and continuation behavior.
  • Empty truncated responses get one fast-mode retry, followed by at most the configured continuation count.
  • Retry and continuation failures preserve the best available output instead of failing the whole task.
  • No generated build artifacts or version files were changed.

Validation

  • npm test — 24 test files, 264 tests passed.
  • npm run typecheck:core — passed.
  • git diff --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.

[Bug] v1.15.1:LLM 截断续写机制失效,长录音纪要全部输出 _[无输出]_

1 participant