Skip to content

feat(cli): forward monitor tracker options - #1275

Open
lntutor wants to merge 1 commit into
mlco2:masterfrom
lntutor:fix/monitor-options-1273
Open

feat(cli): forward monitor tracker options#1275
lntutor wants to merge 1 commit into
mlco2:masterfrom
lntutor:fix/monitor-options-1273

Conversation

@lntutor

@lntutor lntutor commented Jul 26, 2026

Copy link
Copy Markdown

Description

Forward tracker constructor options passed to codecarbon monitor, including --pue and --allow-multiple-runs. Accepted option names are derived from BaseEmissionsTracker.__init__ so the CLI continues to recognize future scalar tracker options. CLI coverage verifies typed float and boolean forwarding.

Related Issue

Fixes #1273

Motivation and Context

The monitor command accepted tracker configuration but did not forward several supported constructor options. This made CLI monitoring behave differently from direct tracker use.

How Has This Been Tested?

  • uv run python -m pytest tests/cli/test_cli_main.py -q
  • uv run ruff check codecarbon/cli/main.py tests/cli/test_cli_main.py
  • uv run ruff format --check codecarbon/cli/main.py tests/cli/test_cli_main.py

uv run mypy codecarbon/cli/main.py is currently blocked by 285 existing type errors across 19 project modules.

Screenshots (if appropriate):

Not applicable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

AI Usage Disclosure

  • 🟥 AI-vibecoded: You cannot explain the logic. Car analogy : the car drive by itself, you are outside it and just tell it where to go.
  • 🟠 AI-generated: Car analogy : the car drive by itself, you are inside and give instructions.
  • ⭐ AI-assisted. Car analogy : you drive the car, AI help you find your way.
  • ♻️ No AI used. Car analogy : you drive the car.

OpenAI Codex assisted with implementation and test preparation. I personally reviewed and tested every submitted line, understand the implementation, and can explain and maintain it.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the docs/how-to/contributing.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@lntutor
lntutor requested a review from a team as a code owner July 26, 2026 10:31
@benoit-cty

Copy link
Copy Markdown
Contributor

Hello, thanks for the contribution. Can you keep our PR template ?

Signed-off-by: Loi Nguyen <vanloi999@gmail.com>
@lntutor
lntutor force-pushed the fix/monitor-options-1273 branch from 060a21e to a3ede3f Compare July 31, 2026 01:30
@lntutor

lntutor commented Jul 31, 2026

Copy link
Copy Markdown
Author

Updated the PR description to the complete repository template, including the required 🟠 AI-generated disclosure. I personally reviewed and tested every submitted line, understand the implementation, and can explain and support it through review and after merge.

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.

Allow all options to codecarbon monitor

2 participants