Repository navigation
fix(mock): report finish_reason after a streamed prompt - #721
Merged
TonsOfFun merged 1 commit intoNov 19, 2026
Merged
Conversation
The mock emitted end_turn in its stream but never recorded it, so response.finish_reason was nil after a streamed prompt.
yorzi
pushed a commit
to yorzi/activeagent
that referenced
this pull request
Nov 19, 2026
…tool-choice-required CHANGELOG: the 1.9.9 section is released, so the entries from activeagents#721 and activeagents#722 move to a new Unreleased section, with entries added for activeagents#712 and activeagents#720. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PCEJHngWphRQ7ArmDnYMmf
yorzi
pushed a commit
to yorzi/activeagent
that referenced
this pull request
Nov 19, 2026
…-1.9.10 Land the community provider fixes activeagents#712, activeagents#720, activeagents#721, activeagents#722
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.
MockProvidersimulates a stream that ends with amessage_deltacarryingstop_reason: "end_turn", butprocess_stream_chunkonly stored it on the in-flight message and never recorded it as the stream's finish reason. A streamed generation has no response body, soresponse.finish_reasonfell back tostreamed_finish_reasonand returnednil. Applications that branch on the finish reason could not exercise that path with the mock provider, unlike with the Anthropic and OpenAI Chat providers.The mock now sets
stream_finish_reasonfrom themessage_delta, the same way the Anthropic provider does. Non-streamed mock responses are unchanged.Test:
test/providers/mock_provider_test.rbgets "a streamed generation reports why it stopped", which expects"end_turn"; it fails onmainwithnil. The whole file passes (13 runs, 0 failures). A CHANGELOG entry is included.This change was made with Claude Code; the tests above were run on the branch.
🤖 Generated with Claude Code