Compare commits

...

1 Commits

Author SHA1 Message Date
fullstack-engineer e02e8055da fix(test): correct test_sanitize_agent_error_stderr_and_exc assertions
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 14s
sop-checklist-gate / gate (pull_request) Successful in 14s
CI / Detect changes (pull_request) Successful in 32s
sop-tier-check / tier-check (pull_request) Successful in 14s
audit-force-merge / audit (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Successful in 8s
CI / Canvas (Next.js) (pull_request) Successful in 11s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 8s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Python Lint & Test (pull_request) Successful in 8m25s
CI / all-required (pull_request) Successful in 6s
The test was asserting `"ValueError" not in out`, but the implementation
correctly uses exc type as the tag (e.g. "Agent error (ValueError): ...").
The comment even said "exc type is the tag" — the assertion was inverted.

Also added assertion that the exc body ("this should not appear") is NOT
in the output, verifying the body comes from stderr as intended.
2026-05-13 12:08:16 +00:00
+3 -2
View File
@@ -761,8 +761,9 @@ def test_sanitize_agent_error_stderr_and_exc():
"""exception + stderr: exc type is the tag, stderr is the body."""
err = ValueError("this should not appear")
out = sanitize_agent_error(exc=err, stderr="rate limit exceeded")
assert "ValueError" not in out # exc class is overridden by stderr
assert "rate limit exceeded" in out
assert "ValueError" in out # exc type is the tag
assert "rate limit exceeded" in out # stderr is the body
assert "this should not appear" not in out # exc body is NOT leaked
def test_sanitize_agent_error_stderr_empty_string():