fix(agent-tools): honor falsey custom output extractors - #4088
Merged
seratch merged 1 commit intoAug 1, 2026
Conversation
n33levo
marked this pull request as ready for review
August 1, 2026 20:02
seratch
enabled auto-merge (squash)
August 1, 2026 23:23
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
Agent.as_tool(custom_output_extractor=...)currently checks the configured extractor by truthiness. A callable object whose__bool__returnsFalseis accepted by the public API but silently skipped, so the nested agent returns its default output instead of the custom result.This changes the guard to an explicit
is not Nonecheck.Nonekeeps the existing fallback behavior; ordinary async functions and the public API are unchanged.Test plan
env UV_DEFAULT_INDEX=https://pypi.org/simple bash .agents/skills/code-change-verification/scripts/run.sh- format, lint, typecheck, and full tests passedmake coverage- 6,034 passed, 8 skipped; 91% total coveragemake tests-asyncio-stability- 5 repetitions passed (7 + 33 tests per repetition)E2E top-hat using the public
Agent.as_toolinvocation path:v0.19.2returneddefault-outputand skipped the falsey extractorcustom-outputand invoked the extractor onceIssue number
N/A - searches across open and closed issues and pull requests found no duplicate.
Checks
.agents/skills/code-change-verification/scripts/run.sh