From e5083d78dc7e16a0143c50dad99dba09bbe60b1c Mon Sep 17 00:00:00 2001 From: Molecule AI Core-DevOps Date: Mon, 11 May 2026 17:25:03 +0000 Subject: [PATCH] fix(tests): correct test_sanitize_agent_error_stderr_and_exc assertion 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 --- workspace/tests/test_executor_helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workspace/tests/test_executor_helpers.py b/workspace/tests/test_executor_helpers.py index a3b0367b..c9f32915 100644 --- a/workspace/tests/test_executor_helpers.py +++ b/workspace/tests/test_executor_helpers.py @@ -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():