Skip to content

Commit 035b2a8

Browse files
author
Mateusz
committed
fix(compression): suppress per-output debug logs for not_applied decision reason
Add 'not_applied' to _NOISY_NOOP_DECISION_REASONS to eliminate debug log spam when compression pipeline runs but doesn't modify content. This is the normal path for outputs that don't match any rule or are below thresholds.
1 parent b396671 commit 035b2a8

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

src/core/services/tool_output_compression_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
_NOISY_NOOP_DECISION_REASONS = frozenset(
7070
{
7171
"already_processed_output",
72+
"not_applied",
7273
"compression_disabled",
7374
"below_min_bytes",
7475
"category_disabled",

tests/unit/core/services/test_tool_output_compression_service.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -761,20 +761,9 @@ async def test_service_logs_debug_for_evaluated_non_applied_output(
761761

762762
assert result.records[0].applied is False
763763
assert result.records[0].failed_open is False
764+
# Suppressed to reduce log noise: not_applied is now in _NOISY_NOOP_DECISION_REASONS
764765
assert len(capture_logger.info_calls) == 0
765-
assert len(capture_logger.debug_calls) == 1
766-
_, metadata = capture_logger.debug_calls[0]
767-
assert metadata["decision_reason"] == "not_applied"
768-
assert metadata["tool_name"] == "shell"
769-
assert metadata["tool_category"] == "command_execution"
770-
assert metadata["bytes_in"] == 4
771-
assert metadata["bytes_out"] == 4
772-
assert metadata["methods_attempted"] == ["inflate"]
773-
assert metadata["methods_applied"] == []
774-
assert metadata["failed_open"] is False
775-
assert metadata["applied"] is False
776-
assert "content" not in metadata
777-
assert "payload" not in metadata
766+
assert len(capture_logger.debug_calls) == 0
778767

779768

780769
@pytest.mark.asyncio

0 commit comments

Comments
 (0)