Repository navigation
Keep hook tracing from crashing on impostor values - #799
Open
RonnyPfannschmidt wants to merge 1 commit into
Open
RonnyPfannschmidt wants to merge 1 commit into
RonnyPfannschmidt wants to merge 1 commit into
Conversation
Choose the rendering from type(), since isinstance() trusts __class__ and a Mock(spec=str) or Mock(spec=dict) claims a type whose methods it lacks. Pass an explicit empty mapping after a hook result, so a dict result is traced as the result instead of as call arguments. Route value formatting through the same failure guard as str() and repr(). Co-Authored-By: Claude Opus 5.5 via Claude Code <noreply@anthropic.com>
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.
Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.
Fixes #792.
type()rather thanisinstance().isinstance()trusts__class__, soMock(spec=str)/Mock(spec=dict)were sent down thestr/dictpaths and raisedTypeErrorfrom inside the hook call.enable_tracingnow ends the "finish" message with an explicit{}. Before, a hook that returned adicthad its result listed as if it were the call's arguments.str()/repr(). A failure shows up in the trace and is not raised.Supersedes the closed #793 and #796.