fix: fall back when provider result is empty - #240
Open
FrundlesTian wants to merge 1 commit into
Open
FrundlesTian wants to merge 1 commit into
FrundlesTian wants to merge 1 commit into
Conversation
|
No blocking issues found. |
This was referenced Sep 23, 2026
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.
Description
Fixes the empty response shown with OpenRouter and other Anthropic-compatible providers that return
ResultMessage.result == ""while still emitting the real response in anAssistantMessage.The result is now stripped once and used only when it contains text. Empty and whitespace-only provider results take the existing AssistantMessage extraction path; non-empty ResultMessage content keeps its current priority.
This is stacked on #236 because that PR currently owns the same result-extraction block. The only diff relative to #236 is this fix, its regression tests, and the changelog entry. After #236 merges, this PR can be retargeted to
mainwithout carrying unrelated commits.Related issue
Closes #171
Type of change
How it was tested
Tests added or updated
Equivalent
make testand formatting/lint commands pass locallyTested by hand against a running bot
pytest --no-cov— 685 passedblack --check src testsisort --check-only src testsflake8 src testsThe regression test covers both an empty string and a whitespace-only result while an AssistantMessage contains the OpenRouter response.
Checklist
CHANGELOG.mdhas an entry under[Unreleased]pyproject.tomldependencies changed,poetry lockwas run and the updatedpoetry.lockis committed (not applicable)README.md,docs/,.env.example,CLAUDE.md) where settings or commands changed (not applicable)