Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions strix/telemetry/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,17 @@ def setup_scan_logging(run_dir: Path, *, debug: bool | None = None) -> Callable[
setattr(stream_handler, _HANDLER_TAG, True)

tracked_loggers = [logging.getLogger(name) for name in _TRACKED_ROOTS]
for tracked in tracked_loggers:
for name, tracked in zip(_TRACKED_ROOTS, tracked_loggers):
tracked.setLevel(logging.DEBUG)
tracked.addHandler(file_handler)
tracked.addHandler(stream_handler)
# The openai-agents SDK emits one DEBUG record per span / function-call
# / reasoning-item. Routing that to stdout -- which Docker's json-file
# driver captures without rotation -- can grow the sandbox container log
# to tens of GB and exhaust the host disk on long runs. Keep its verbose
# DEBUG in the per-scan strix.log file only; stdout stays on Strix's own
# logger.
if name != "openai.agents":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Exclusion list is not co-located with _TRACKED_ROOTS

The string "openai.agents" appears only at the call site, disconnected from the _TRACKED_ROOTS definition at line 64. If a future contributor adds another chatty SDK to _TRACKED_ROOTS, there's no signal that this exclusion logic exists. A small named constant (e.g. _STDOUT_EXCLUDED_ROOTS: frozenset[str] = frozenset({"openai.agents"})) defined next to _TRACKED_ROOTS would keep the two declarations together and make the intent discoverable.

Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/telemetry/logging.py
Line: 134

Comment:
**Exclusion list is not co-located with `_TRACKED_ROOTS`**

The string `"openai.agents"` appears only at the call site, disconnected from the `_TRACKED_ROOTS` definition at line 64. If a future contributor adds another chatty SDK to `_TRACKED_ROOTS`, there's no signal that this exclusion logic exists. A small named constant (e.g. `_STDOUT_EXCLUDED_ROOTS: frozenset[str] = frozenset({"openai.agents"})`) defined next to `_TRACKED_ROOTS` would keep the two declarations together and make the intent discoverable.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

tracked.addHandler(stream_handler)
Comment on lines +134 to +135

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 ERROR/WARNING from openai.agents also silenced on stdout

The guard if name != "openai.agents" removes the stream handler entirely, not just at DEBUG level. In production mode (debug=False) the stream handler runs at ERROR, meaning that before this change openai.agents ERROR records did reach stdout; after it they go only to strix.log. The PR description focuses on the DEBUG flood, but this is a silent secondary behaviour change. If operators or external monitors tail stdout for SDK errors (API failures, auth issues, etc.) they'll now miss them.

Consider attaching the stream_handler unconditionally and instead raising its floor for openai.agents to WARNING (or ERROR) to stop the DEBUG flood while keeping higher-severity signals visible on stdout.

Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/telemetry/logging.py
Line: 134-135

Comment:
**ERROR/WARNING from `openai.agents` also silenced on stdout**

The guard `if name != "openai.agents"` removes the stream handler entirely, not just at DEBUG level. In production mode (`debug=False`) the stream handler runs at `ERROR`, meaning that before this change `openai.agents` ERROR records did reach stdout; after it they go only to `strix.log`. The PR description focuses on the DEBUG flood, but this is a silent secondary behaviour change. If operators or external monitors tail stdout for SDK errors (API failures, auth issues, etc.) they'll now miss them.

Consider attaching the stream_handler unconditionally and instead raising its floor for `openai.agents` to `WARNING` (or `ERROR`) to stop the DEBUG flood while keeping higher-severity signals visible on stdout.

How can I resolve this? If you propose a fix, please make it concise.

tracked.propagate = False

for name in _NOISY_LIBS:
Expand Down