Stop injecting placeholder tokens in Responses Ollama inference - #280
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
Stop injecting placeholder tokens in Responses Ollama inference#280sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29c9b70357
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
sylvesterkaczmarek
force-pushed
the
fix/responses-ollama-noop-token
branch
from
August 16, 2026 18:44
e1c93da to
c58b91e
Compare
|
Note You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Stop the Responses API Ollama backend from manufacturing token id
0when a streamed token is temporarily unavailable, without blocking the async server while waiting for the next token.The Ollama inference callable now performs a non-blocking poll. It returns
Nonewhile the stream is active with no buffered token, and the shared Responses event loop treats that as an internal retry state: it yields asynchronously, appends and parses nothing, and re-checks client disconnects on the next iteration.Fixes #279.
Fix
EOS_TOKEN; never manufacture token0;Regression coverage
Adds focused tests verifying that:
Noneimmediately without callingtime.sleep;EOS_TOKEN;EOS_TOKEN;EOS_TOKEN.Ollama request payloads, tokenization, error propagation, and timeout values are otherwise unchanged.
The branch is based directly on current
mainand collapsed to one signed-off commit.