Skip to content

[codex] Fix CLI argparse type mismatches in opf.__main__#3

Open
romgenie wants to merge 1 commit intoopenai:mainfrom
romgenie:codex/fix-cli-argparse-type-mismatches
Open

[codex] Fix CLI argparse type mismatches in opf.__main__#3
romgenie wants to merge 1 commit intoopenai:mainfrom
romgenie:codex/fix-cli-argparse-type-mismatches

Conversation

@romgenie
Copy link
Copy Markdown

Summary

Normalizes Sequence[str] inputs to list[str] before forwarding them into parser helpers in opf/__main__.py.

This fixes pyright/Pylance argument type errors in the unified CLI entrypoint without changing runtime behavior.

Changes

  • Convert argv to list[str] | None inside opf.__main__.py:parse_args before calling ArgumentParser.parse_args
  • Convert argv to list[str] in the opf eval --help dispatch path before calling opf._eval.args.parse_args

Why

opf.__main__ accepts Sequence[str] for convenience, but the parser helpers it calls are typed as accepting list[str] | None. That produced a static type error in Pylance/pyright even though runtime behavior was fine.

This keeps the public wrapper signatures unchanged and normalizes at the call boundary.

Verification

pyright opf/__main__.py

Result:

0 errors, 0 warnings, 0 informations

@romgenie romgenie marked this pull request as ready for review April 22, 2026 20:10
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.

1 participant