Skip to content

fix(cli): hide the internal run worker from lab usage - #1172

Merged
Birfy merged 1 commit into
mainfrom
agent/1171-lab-hides-internal-run
Nov 19, 2026
Merged

Birfy merged 1 commit into
mainfrom
agent/1171-lab-hides-internal-run

Conversation

@Birfy

@Birfy Birfy commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Closes #1171

What changed

After #1169, lab mounts every verb, including the internal run worker that evolve --detach spawns. Help already omitted its line, and _visible_choices already stripped it from choose from, but the lab subparsers left argparse's default metavar, so agentdescent lab --help and the usage line on a lab argparse error (plain and --json) listed run in the braces.

build_parser now sets that metavar from the public choices, the same #420 contract as the top-level usage line. agentdescent lab run --run-dir … still parses.

  • agentdescent/cli.py: set lab_sub.metavar from choices minus _INTERNAL_COMMANDS.
  • tests/test_cli_help_hides_internal_run.py: pin help/usage, a typo error, the --json envelope, and that lab run still parses.
  • changelog.d/1171-lab-hides-internal-run.md.

No other verb's arguments, output, or exit code change.

Verification

Tip SHA: 594b177

Red first, at origin/main 367d140f with only the new tests:

  • FAILED test_lab_help_and_usage_do_not_list_run — run in the braces
  • FAILED test_lab_every_listed_verb_has_a_help_line — run has no help line
  • FAILED test_lab_unknown_verb_error_does_not_list_run — usage on lab xyz lists run
  • FAILED test_lab_unknown_verb_json_hides_run — --json usage lists run
  • test_lab_run_still_parses passed (already reachable)

Ran:

  • pytest -q tests/test_cli_help_hides_internal_run.py tests/test_cli_lab_grouping.py → 128 passed
  • python -m tools.changelog_fragments check → 83 changelog fragment(s) OK
  • agentdescent lab --help usage braces start {demo,init,plan,evolve,status,watch,...} (no run)
  • agentdescent --json lab xyz — "run" is not in error or usage

Not run:

No UI surface: terminal help and argparse error text only.

Closes #1171

The lab subparsers left argparse's default metavar, so `lab --help`
and lab argparse errors listed `run` in the braces after #1169. Set
the metavar from the public choices, the same #420 contract as the
top-level usage line. `lab run` still parses.
@Birfy

Birfy commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Self-review (Birfy)

Tip SHA: 594b177
Ran:

  • .github/scripts/risk_gate.py --pr 1172 → T2 (cli.py package code; 60 lines / 3 files)
  • pytest -q tests/test_cli_help_hides_internal_run.py tests/test_cli_lab_grouping.py → 128 passed
  • python -m tools.changelog_fragments check → 83 fragments OK
  • Red first: the four new lab rows failed on origin/main (367d140) with run in the braces; test_lab_run_still_parses already passed
  • agentdescent lab --help and agentdescent --json lab xyz no longer list run in the usage metavar
    Not run:
  • Full offline suite — the CI test matrix is the line
  • gen_api_docs — no public API docstring change
    Findings:
  • No actionable defects. The lab usage metavar now uses the public choices, matching the cli: agentdescent --help prints run ==SUPPRESS== and advertises the internal run worker in usage #420 contract already applied at the top level. lab run still parses.
    Verdict: PASS

@Birfy
Birfy enabled auto-merge (squash) November 19, 2026 22:27
@Birfy
Birfy merged commit 6b034fd into main Nov 19, 2026
10 checks passed
@Birfy
Birfy deleted the agent/1171-lab-hides-internal-run branch November 19, 2026 22:54
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.

lab --help still lists the internal run worker in the usage line

1 participant