Skip to content

fix(strategy): report unknown --transform cleanly instead of KeyError traceback (Fixes #199)#206

Open
RealDiligent wants to merge 1 commit into
zeokin:mainfrom
RealDiligent:fix/strategy-cli-unknown-transform
Open

fix(strategy): report unknown --transform cleanly instead of KeyError traceback (Fixes #199)#206
RealDiligent wants to merge 1 commit into
zeokin:mainfrom
RealDiligent:fix/strategy-cli-unknown-transform

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

PR kind

  • fix
  • feat

Summary

Fixes #199python -m strategy --transform nope raised an uncaught KeyError traceback (exit 1) instead of the project CLI contract (error: … on stderr, exit 2).

  • Validate the transform name via get_transform() before any GPU work in runner.run / runner.compare
  • Catch KeyError alongside the existing (ValueError, RuntimeError, MemoryError) handler

Validation

  • uv run --extra test python -m pytest tests/test_cli_errors.py -v (9 passed)
  • uv run python -m strategy.smoke
  • uv run --extra test python -m pytest tests/ strategy/tests/ eval/tests/ -q

GPU Result (required for feat PRs only)

N/A — fix lane.

Checklist

  • CPU-safe validation passed
  • My commits do not include Co-authored-by footers for coding agents
  • Correctness gates pass

@github-actions github-actions Bot added area:strategy Smart strategies / transforms (strategy/) area:tests Correctness gates and test suites (tests/) status:needs-review Awaiting maintainer review type:bug Something is incorrect or broken status:ready-non-gpu Fix/docs PR cleared non-GPU triage; maintainer review only labels Jul 12, 2026
@zeokin

zeokin commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Thanks — this fix is verified and I want to merge it, but it now conflicts with the just-merged #189 (fix/data-rank-reject). Both PRs append a new test function to tests/test_cli_errors.py at the same spot, so it's a trivial add/add conflict — your strategy/cli.py change merges cleanly on its own.

Please rebase onto the latest main and keep both test functions (yours for the unknown---transform error plus #189's for --data-rank). Once it's green again I'll merge. A new commit resets the bot's conflict timer.

@github-actions

Copy link
Copy Markdown
Contributor

This PR currently has merge conflicts with the base branch. Please resolve them within 12 hours or the bot will close the PR automatically.

@github-actions github-actions Bot removed the status:ready-non-gpu Fix/docs PR cleared non-GPU triage; maintainer review only label Jul 13, 2026
@RealDiligent RealDiligent force-pushed the fix/strategy-cli-unknown-transform branch from a7d10db to bf79f1d Compare July 13, 2026 11:42
@github-actions github-actions Bot added the status:ready-non-gpu Fix/docs PR cleared non-GPU triage; maintainer review only label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:strategy Smart strategies / transforms (strategy/) area:tests Correctness gates and test suites (tests/) status:needs-review Awaiting maintainer review status:ready-non-gpu Fix/docs PR cleared non-GPU triage; maintainer review only type:bug Something is incorrect or broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] strategy CLI: unknown --transform raises uncaught KeyError instead of clean exit 2

2 participants