Skip to content

Comments

fix logUnguarded() to respect Model::unguard()#1444

Merged
freekmurze merged 1 commit intomainfrom
fix/log-unguarded-global
Jan 31, 2026
Merged

fix logUnguarded() to respect Model::unguard()#1444
freekmurze merged 1 commit intomainfrom
fix/log-unguarded-global

Conversation

@freekmurze
Copy link
Member

Summary

  • Fixed issue where logUnguarded() didn't work when Model::unguard() was called globally
  • When Model::unguard() is called, isUnguarded() returns true but getGuarded() still returns its default value
  • The code was only checking $guarded property, not the global unguarded state
  • Now properly checks isUnguarded() to detect globally unguarded models
  • Added test to verify logging works when Model::unguard() is called globally

Fixes #1123

🤖 Generated with Claude Code

When Model::unguard() is called globally, the $guarded property still
contains its default value but isUnguarded() returns true. The code was
only checking $guarded, not the unguarded state.

Now checks isUnguarded() to properly detect globally unguarded models.

Fixes #1123

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@freekmurze freekmurze merged commit d6f9716 into main Jan 31, 2026
31 checks passed
@freekmurze freekmurze deleted the fix/log-unguarded-global branch January 31, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

logUnguarded() does not respect Model::unguard()

1 participant