Skip to content

fix(agent-guard): unify agent_guard import style in test_opencode.py#960

Merged
justinmclean merged 1 commit into
apache:mainfrom
HeaTTap:fix/unify-agent-guard-import-in-test-opencode
Jul 27, 2026
Merged

fix(agent-guard): unify agent_guard import style in test_opencode.py#960
justinmclean merged 1 commit into
apache:mainfrom
HeaTTap:fix/unify-agent-guard-import-in-test-opencode

Conversation

@HeaTTap

@HeaTTap HeaTTap commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #955

Unified the import statement for agent_guard in tools/agent-guard/tests/test_opencode.py to use from agent_guard import ... consistent with test_kiro.py.

@justinmclean justinmclean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is sound. After it, agent_guard has no remaining attribute references in the file, so dropping import agent_guard leaves nothing dangling. All five names on the from-import are used: ALLOW_EXIT (6), DENY_EXIT (4), cli (3), opencode_main (8), dispatch (3). Nothing in the file monkeypatches the module object, so the module binding was genuinely only there for the one agent_guard.dispatch(...) call.

@justinmclean
justinmclean merged commit d90c2d4 into apache:main Jul 27, 2026
9 checks passed
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.

Use a single import form for agent_guard in test_opencode.py

2 participants