fix(llm): surface structured provider refusals - #944
Merged
Conversation
bearsyankees
marked this pull request as ready for review
July 31, 2026 14:34
Contributor
Greptile SummaryThe PR now handles structured model-provider refusals through the normal agent failure lifecycle.
Confidence Score: 5/5The PR appears safe to merge. The previously reported non-interactive refusal issue is fixed: the refusal handler now records a failed terminal status and notifies the parent before returning, so the generic non-interactive re-raise is no longer reached. Important Files Changed
Reviews (2): Last reviewed commit: "fix(llm): settle refused autonomous agen..." | Re-trigger Greptile |
Collaborator
Author
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Aug 1, 2026
Resolves the overlap with #944 (structured provider refusals), which edits the same terminal-error block in _run_cycle: - keep #944's ProviderRefusalError park (visible failure + parent notice) - keep this branch's removal of the guardrail special case, so a guardrail rejection flows through normal classification like any other model error - run _salvage_stream_to_session before the refusal park so a refusal-parked agent keeps its context on revival - keep both sides' tests; restore the MagicMock import and make the refusal stream helper type-check
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
ResponseOutputRefusalitems after a streamed run completesWhy
Some providers return policy refusals as successful response output rather than raising an API exception. Strix previously treated those turns as normal final output and parked the interactive agent in
waiting, hiding the actual failure.Testing
poetry run pytest tests/test_execution.py tests/test_execution_transient_retry.py tests/test_e2e_budget_lifecycle.py -q(44 passed)poetry run ruff check strix/core/execution.py tests/test_execution.pypoetry run mypy strix/core/execution.pyfailedwith the full provider message