Repository navigation
Inkling 2: one empty answer delta when a stream starts withholding its reasoning - #2720
Merged
Merged
Conversation
…s reasoning
With reasoning off, Inkling 2 still thinks and the provider withholds that
thought, so a stream sends only its role preamble until the answer. When
withholding starts, the router now emits one event the coordinator serving
path writes as a plain chunk with delta {"content": ""}: no role, no
reasoning field, no finish reason, no usage, nothing derived from the
withheld text (InklingWithheldReasoningHeartbeat). It claims output first,
as a first content frame does. Only the coordinator path turns it on;
reasoning-on Inkling streams, other models and non-streamed responses are
unchanged. An empty content delta is a legal OpenAI streaming chunk.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Nov 24, 2026
This branch was successfully deployed
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.
Summary
When a streamed Inkling 2 request turns reasoning off, the model still thinks before it answers and the provider withholds that thought, so the stream carries only its role preamble until the first answer token. With a long thought the first content can arrive many seconds in.
When withholding starts, the provider now sends exactly one chunk whose delta is
{"content": ""}:rolekey (the line contains noroletext at all), no reasoning field, no finish reason, no usage;An empty
contentdelta is a legal OpenAI streaming chunk; stream parsers append it as nothing.How: the Inkling router emits one marker event at the first withheld reasoning piece (
InklingWithheldReasoningHeartbeat.event); the coordinator serving path, which alone turns it on (a task-local set around the stream's start), rewrites that frame to the chunk above (frame(rewriting:)) and claims output first, as a first content frame does. Every other path, reasoning-on Inkling streams, other models and non-streamed responses are unchanged. No new log line; withheld reasoning is still counted as reasoning and never emitted. No rendered prompt changes.Side effects (Inkling 2, withheld reasoning, streamed, coordinator path only)
These match what a reasoning-on stream already does once its first reasoning chunk leaves:
strictcall that fails its check after the empty delta leaves as generated (StrictToolCallPolicy) instead of being refused, since the stream is already committed.Client note
openai-go's
ChatCompletionAccumulatortreats"content": ""as content state: for a reasoning-off Inkling answer that is only a tool call,JustFinishedContent()fires once with"", and the accumulated content stays"". That is a helper-signal artefact, not a message.Test plan
InklingWithheldReasoningHeartbeatTestsrole,reasoning,usageorfinish_reasontext;[DONE]) left alone;aWithheldThoughtStartsWithExactlyOneEmptyAnswerDelta(3 cases),callsAndStopsAreUnaffected,theFrameIsAPlainEmptyContentChunk,theSDKStreamCarriesExactlyOneHeartbeatFrame.scripts/changelog.py check.Refactor pass: no change justified.
Components touched
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.