forked from HAL9000/cleveragents-core
0851050db6
Root cause: structlog's default PrintLoggerFactory writes to sys.stdout
when structlog is not configured. The DI container initializes the
plugin_manager and calls register_all_extension_points() which emits
30+ debug log lines. These debug lines polluted the stdout of every CLI
command, causing e2e Robot Framework tests to fail when checking that
machine-readable output (--format json/yaml/plain) contains expected values.
Fix:
- Added configure_structlog(log_level="WARNING") in get_container() before
Container() is instantiated, ensuring structlog is configured to use
Python's stdlib logging (which defaults to StreamHandler on stderr) before
any debug messages are emitted.
- Added configure_structlog(log_level="WARNING") to main() and main_callback()
for defense in depth (fast-path commands that may not use the container).
- Added Skip If No LLM Keys to m1_acceptance and m2_acceptance e2e tests
so they skip gracefully in CI when ANTHROPIC_API_KEY/OPENAI_API_KEY are absent.
The e2e_tests were already failing before the 3 problematic direct-push
commits (see CI history on commit 6dfd7e6b35). This fix addresses both
the pre-existing issue and any regression from the fix branch commits.
Verified locally:
- agents init stdout is clean (no debug logs)
- smoke_test.robot: 2/2 PASS
- ruff check/format: all clean
- pyright: 0 errors