Skip to content

fix(streaming_hints): close a finished uncertain sentence - #357

Merged
codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
GPT-AGI:fix/streaming-hints-finished-sentence
Nov 16, 2026
Merged

codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
GPT-AGI:fix/streaming-hints-finished-sentence

Conversation

@GPT-AGI

@GPT-AGI GPT-AGI commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

On current main, this stopped completion returns with no hint and does not continue:

Speed is 80 km/h. Wait, the question asks for meters per second.

StreamingHintRetriever.feed closes punctuation only when whitespace follows, so the final uncertain sentence stays pending.

A normal stop now flushes that sentence through the existing gap, uncertainty, and threshold rules. Length/full-budget truncation and other finish reasons do not flush; a regression test preserves 3. + 14 across segments.

Verified with Python 3.12 and the CI dependency set: python -m pytest tests/test_streaming_hints.py tests/test_plugins.py tests/test_plugin_gating.py -q (48 passed).

feed() only ends a sentence when punctuation is followed by whitespace, so a
normally stopped reply such as "Wait, check the units." stayed pending and no
hint was injected. Flush that trailing sentence only when the segment finishes
normally.

Signed-off-by: Ting Zhang <181050363+GPT-AGI@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@CLAassistant

CLAassistant commented Nov 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codelion
codelion merged commit 16540d6 into algorithmicsuperintelligence:main Nov 16, 2026
6 checks 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.

3 participants