Codex Review: Here are some suggestions.
|
def script_supports_subcommand(script: Path, name: str) -> bool: |
|
"""Return True if the script advertises a Typer-style subcommand.""" |
|
|
|
help_text = script_help_text(script) |
|
if "Commands:" not in help_text: |
|
return False |
|
_, commands_section = help_text.split("Commands:", 1) |
|
for line in commands_section.splitlines(): |
|
command_name = line.strip().split(" ", 1)[0] if line.strip() else "" |
|
if command_name == name: |
|
return True |
[P1] Subcommand detection ignores Typer help output
The new script_supports_subcommand parser trims each help line with strip() and then splits on the first space, but Typer’s rich help output prefixes command rows with box‑drawing characters (│ ask …). After strip() the line still begins with │, so command_name becomes │ and the function never returns True even when subcommands exist. As a result the harness will fail to append required subcommands (e.g. ask) for Typer CLIs that actually require them, leading to python -m … invocations that error with “Missing command”. Consider stripping non‑alphanumeric prefixes or using a regex to extract the command token.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
Originally posted by @chatgpt-codex-connector[bot] in #212 (review)
Codex Review: Here are some suggestions.
rag_writer/run_rag_verification.py
Lines 643 to 653 in a90375f
[P1] Subcommand detection ignores Typer help output
The new
script_supports_subcommandparser trims each help line withstrip()and then splits on the first space, but Typer’s rich help output prefixes command rows with box‑drawing characters (│ ask …). Afterstrip()the line still begins with│, socommand_namebecomes│and the function never returnsTrueeven when subcommands exist. As a result the harness will fail to append required subcommands (e.g.ask) for Typer CLIs that actually require them, leading topython -m …invocations that error with “Missing command”. Consider stripping non‑alphanumeric prefixes or using a regex to extract the command token.Reply with
@codex fix commentsto fix any unresolved comments.About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
Originally posted by @chatgpt-codex-connector[bot] in #212 (review)