Skip to content

DeprecationWarning from policy.py is invisible in normal bmad-loop CLI use #835

Description

@gmoncor

Found via CodeRabbit review on #814 (verified): Python suppresses DeprecationWarning by default everywhere except code running directly in __main__. bmad_loop.policy.loads() lives in library code reached through bmad_loop.cli, not __main__, and nothing in cli.py broadens the global filter for the normal command path (the one warnings.simplefilter("always") call in cli.py is scoped to a catch_warnings() block inside _validate_plugin_manifests, unrelated to policy loading).

This means both the pre-existing [engine] deprecation notice (_fold_deprecated_engine) and the new legacy-retry-mode notice added in #814 emit a real DeprecationWarning, covered by pytest.warns in tests, but a user running bmad-loop normally will likely never see either — pytest.warns establishes the warning fires, not that it reaches the user.

Suggested directions (not prescribing one)

Scope note

This is cross-cutting (affects at least #811 and #814, both currently open/ready), not specific to one PR, so it deserves its own decision rather than a one-off fix inside either PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions