summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/tests/conftest.py
diff options
context:
space:
mode:
authorMohamed Hegazy <mhegazy@anthropic.com>2026-10-15 16:31:46 +0000
committerClaude <noreply@anthropic.com>2026-10-15 16:31:46 +0000
commitced6733eee6aa246e2af55ce0c71e38c01a50141 (patch)
tree1c7abeca25d5625d06934d3ea1141cf554edcd92 /plugins/security-guidance/tests/conftest.py
parentd876712c3801b10bb1258da9b8f71fa7b41320e4 (diff)
security-guidance: print one JSON document from the SessionStart hook on other hostsmhegazy/sg-portable-session-start
On a host other than Claude Code the SessionStart hook printed an async declaration line and then a metrics line. A host that reads hook output as one JSON document with a closed schema rejects that. In portable mode the hook now skips the async line and prints one object with only the standard fields. The portable-mode helpers move to _base.py so both hook scripts share them, and the mode is decided once at start-up. Output under Claude Code is unchanged.
Diffstat (limited to 'plugins/security-guidance/tests/conftest.py')
-rw-r--r--plugins/security-guidance/tests/conftest.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/security-guidance/tests/conftest.py b/plugins/security-guidance/tests/conftest.py
index 11af0273..998401c2 100644
--- a/plugins/security-guidance/tests/conftest.py
+++ b/plugins/security-guidance/tests/conftest.py
@@ -128,7 +128,8 @@ def hook_env(tmp_path, stub_api):
"CLAUDE_PROJECT_DIR", "HTTP_PROXY", "HTTPS_PROXY",
"http_proxy", "https_proxy", "ALL_PROXY", "all_proxy",
"CLAUDE_CODE_USE_BEDROCK", "CLAUDE_CODE_USE_VERTEX",
- "CLAUDE_CODE_USE_FOUNDRY")}
+ "CLAUDE_CODE_USE_FOUNDRY",
+ "PLUGIN_ROOT", "SECURITY_GUIDANCE_PORTABLE_OUTPUT")}
env.update(GIT_ENV)
env.update({
"SECURITY_WARNINGS_STATE_DIR": str(state),