fix(tests): correct test_sanitize_agent_error_stderr_and_exc assertion
All checks were successful
sop-tier-check / tier-check (pull_request) Successful in 18s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 58s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 6s
publish-runtime-autobump / bump-and-tag (pull_request) Has been skipped
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 15s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 9s
Harness Replays / detect-changes (pull_request) Successful in 11s
Harness Replays / Harness Replays (pull_request) Successful in 6s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 15s
CI / Detect changes (pull_request) Successful in 27s
E2E API Smoke Test / detect-changes (pull_request) Successful in 25s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 23s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 23s
CI / Canvas (Next.js) (pull_request) Successful in 8s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 8s
CI / Platform (Go) (pull_request) Successful in 8s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 6s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 7s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
publish-runtime-autobump / pr-validate (pull_request) Successful in 41s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 2m18s
audit-force-merge / audit (pull_request) Has been skipped
CI / Python Lint & Test (pull_request) Successful in 6m50s

The test expected the exception class to be hidden when stderr is provided,
but the implementation always uses the exc type as the tag. Fix the
assertion to match actual (correct) behavior: ValueError is in the tag,
stderr is the body. Also add a check that we don't fall back to the
generic "workspace logs" form.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Molecule AI · core-devops 2026-05-11 17:25:03 +00:00
parent 5dbfd81b0e
commit e5083d78dc

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 "ValueError" in out # exc class is the tag, not overridden
assert "rate limit exceeded" in out
assert "workspace logs" not in out # stderr form, not the generic form
def test_sanitize_agent_error_stderr_empty_string():