Skip to content

fix: show when a streamed reply reaches its output limit - #6967

Open
Lanqiao-Luca wants to merge 1 commit into
ChatGPTNextWeb:mainfrom
Lanqiao-Luca:codex/show-stream-output-limit
Open

Lanqiao-Luca wants to merge 1 commit into
ChatGPTNextWeb:mainfrom
Lanqiao-Luca:codex/show-stream-output-limit

Conversation

@Lanqiao-Luca

@Lanqiao-Luca Lanqiao-Luca commented Dec 1, 2026 •

Copy link
Copy Markdown

💻 变更类型 | Change Type

  • fix

🔀 变更说明 | Description of Change

Addresses the streamed-reply truncation part of #6961.

OpenAI's finish_reason: "length" and Anthropic's stop_reason: "max_tokens" now give the message a persistent output-limit notice. The notice appears even when the model emits no text. Partial text stays intact for copying and subsequent conversation, and an empty truncated reply is omitted from subsequent model input.

📝 补充信息 | Additional Information

  • Six Jest cases exercise the actual provider adapters and stream handlers with synthetic events. Four truncation cases reproduce on the upstream base; both normal-stop controls pass on the base and with the fix.
  • Two additional local cases exercise saving and rehydrating partial and empty truncated replies using the chat store, with in-memory storage standing in for IndexedDB. Both fail on the base and pass with the fix.
  • The full project Jest suite passes on macOS (37 suites, 180 tests). TypeScript checks pass. Scoped ESLint has zero errors and the same four warnings as the upstream base. No API keys or provider requests were used.

Prepared with assistance from OpenAI Codex.

This branch has not been deployed

No deployments
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