Skip to content

Codex Review: Here are some suggestions. #214

Description

@pfahlr

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions