summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/hooks/_base.py
diff options
context:
space:
mode:
authorMohamed Hegazy <8000722+mhegazy@users.noreply.github.com>2026-11-06 11:42:19 -0800
committerGitHub <noreply@github.com>2026-11-06 11:42:19 -0800
commitb4720bd2ea255d57666fbf3aa6fbe5a40435089e (patch)
tree48542187ecab7b3a111ffdefa0c1f5d1d86016c9 /plugins/security-guidance/hooks/_base.py
parent385e32d91174c6955f5cc52f9a84da314fddb3a0 (diff)
parenta7ae8adaac24a60a6ec0c030f3333d288811db45 (diff)
Merge pull request #6997 from anthropics/mhegazy/sg-net-err-on-verdict
security-guidance: clear net_err when a review gets through
Diffstat (limited to 'plugins/security-guidance/hooks/_base.py')
-rw-r--r--plugins/security-guidance/hooks/_base.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/security-guidance/hooks/_base.py b/plugins/security-guidance/hooks/_base.py
index 523049c1..99607e4a 100644
--- a/plugins/security-guidance/hooks/_base.py
+++ b/plugins/security-guidance/hooks/_base.py
@@ -240,7 +240,7 @@ _USAGE = {
# reported it manually.
"http_err_last": 0, # most recent HTTP error code this invocation
"http_err_count": 0, # total HTTP errors (4xx + 5xx + network)
- "net_err": 0, # why the last call got no HTTP response, 0 if it got one
+ "net_err": 0, # why the deciding call got no HTTP response, 0 if it got one
# For the usage log line only: model ids as recorded (the requested alias
# on the Agent SDK path), and whether any call had no price-table entry.
"models": [],
@@ -336,7 +336,9 @@ def _record_net_error(code):
raises outside its own error type (a default TLS context that cannot be
built, a connection closed before the reply) has no `api_error` at all.
Emitted as `net_err` on the row of a hook whose last call failed this
- way; a later call clears it."""
+ way; a later call clears it, and so does a call that gets through beside
+ it (a second probe, the other leg of a dual review, the agentic run that
+ wins a race)."""
try:
c = int(code)
except (TypeError, ValueError):