fix(runtime): surface invalid generated token failures - #8
Merged
Merged
Conversation
kanadaj
force-pushed
the
fix/invalid-token-failure
branch
from
September 14, 2026 14:48
4059ace to
fae68fb
Compare
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.
The scheduler currently converts an out-of-vocabulary generated token into an ordinary stop, and a speculative overrun can further hide it as a length finish. Clients can therefore receive a successful response after an engine-level token failure. This change reports the condition as an HTTP 500
InvalidTokenError, excludes the faulty token, and carries the failure through Chat, Anthropic Messages, and Responses clients.The three-layer scope is required:
schedule_batch.pyproduces an abort and prevents the output cap from replacing it.[DONE], and terminates.failedwith aserver_errorpayload andresponse.failed; graceful aborts without a status remain cancelled.The publishable profile keeps the existing Responses runtime snapshot unchanged. Patch
0019and its post-patch source snapshot are independently attested, and the Dockerfile combines them with the existing API compatibility files.Validation:
0015,0016, and0019apply cleanly; all 4,392 source records match, followed by a second final-tree verification.This is CPU-tested only. No image was built, published, or deployed. The change overlaps
serving_responses.pyin #5 andserving_chat.pyin #6, so it will need a mechanical rebase if either lands first.