Skip to content

fix(cli): suppress noisy warnings in experiment output#1

Merged
0xthc merged 1 commit into
mainfrom
fix/suppress-noisy-warnings
Mar 13, 2026
Merged

fix(cli): suppress noisy warnings in experiment output#1
0xthc merged 1 commit into
mainfrom
fix/suppress-noisy-warnings

Conversation

@0xthc
Copy link
Copy Markdown
Contributor

@0xthc 0xthc commented Mar 13, 2026

Summary

  • Suppress ResourceWarning (unclosed sockets/transports from httpx, asyncio) that clutter CI logs
  • Suppress RuntimeWarning (package rename notices like duckduckgo_search → ddgs)
  • Warnings are filtered before experiment modules execute, so only experiment output noise is affected

Before

/opt/.../httpx/_models.py:195: ResourceWarning: unclosed <socket.socket fd=33, ...>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/opt/.../asyncio/selector_events.py:879: ResourceWarning: unclosed transport <_SelectorSocketTransport fd=28 ...>
/home/runner/.../web_search.py:38: RuntimeWarning: This package (`duckduckgo_search`) has been renamed to `ddgs`!

(repeated dozens of times per experiment run)

After

Clean output — only experiment results and evaluator tables shown.

Test plan

  • Run cobalt run --ci on llm-obs-benchmark — verify warning noise is gone
  • Verify experiment results still display correctly

🤖 Generated with Claude Code

User experiment code and third-party libraries (httpx, asyncio,
duckduckgo_search) emit unclosed socket/transport ResourceWarnings and
package-rename RuntimeWarnings that clutter CI output without being
actionable. Filter them out before running experiment modules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 13, 2026 00:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Suppresses Python warnings that clutter CI logs during experiment runs by adding warnings.filterwarnings calls before experiment execution.

Changes:

  • Adds blanket ignore filters for ResourceWarning and RuntimeWarning in the CLI run command

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/cobalt/cli/main.py
# code and third-party libraries — these clutter CI output without being
# actionable by the experiment author.
warnings.filterwarnings("ignore", category=ResourceWarning)
warnings.filterwarnings("ignore", category=RuntimeWarning)
@0xthc 0xthc merged commit 87fbc6d into main Mar 13, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants