Skip to content

refactor(cli): remove dead command surface (dup dependency decorator, models typo-stub, no-op nodes refresh)#515

Open
mattmillerai wants to merge 2 commits into
mainfrom
matt/be-2978-dead-surface-cleanup
Open

refactor(cli): remove dead command surface (dup dependency decorator, models typo-stub, no-op nodes refresh)#515
mattmillerai wants to merge 2 commits into
mainfrom
matt/be-2978-dead-surface-cleanup

Conversation

@mattmillerai

Copy link
Copy Markdown
Collaborator

ELI-5

The CLI had three "dead" spots on its command surface. Removing them so every
command name means exactly one real thing, and nothing registered does nothing:

  1. dependency was registered twice (two stacked @app.command decorators).
  2. A hidden models "did you mean comfy model?" typo-stub sat in cmdline.py,
    but it was shadowed by the real models sub-app, so it was unreachable dead code.
  3. comfy nodes refresh was an honest no-op — it just printed
    "nothing to refresh" and exited. A registered command that does nothing erodes
    trust in every other command.

What changed

  • dependency — deduplicated. Collapsed the two stacked @app.command
    decorators into a single @app.command(hidden=True, help=...). The name now
    registers exactly one implementation. Behavior is unchanged (it was already
    effectively hidden — the hidden=True decorator was the one that won), and the
    function body is untouched.
  • models typo-stub — removed. The hidden def models() in cmdline.py was
    shadowed by app.add_typer(..., name="models") (the real model-discovery
    sub-app), so comfy models always resolved to the sub-app and the stub's
    message was never reachable. Pure dead-code removal.
  • nodes refresh — removed. object_info is fetched live on every command,
    and the on-disk cache is auto-written on each successful fetch via
    resilient_load_object_info (cache + refresh-retry + stale fallback). A manual
    refresh therefore has nothing to do — every comfy nodes <cmd> already
    refreshes the cache when the server is reachable. Removed rather than
    reimplemented (see note below).

--help before → after

Top-level comfy --help command list — the only change is that models
relocates in the list (its help text is unchanged). This is a side effect of
removing the dead stub: the stub registered the models key early (right after
env), and Python dicts keep a key's first-insertion position even when the value
is later overwritten by the real sub-app. With the stub gone, the models key is
first inserted where the real sub-app is registered — next to model / node /
nodes, which is where it belongs. No command is added or removed at the top level.

- models        Discover models — folders, files, and the cloud asset catalog.   # (was up near env/feedback)
  ...
  nodes         Introspect ComfyUI node classes (inputs, outputs, categories).
+ models        Discover models — folders, files, and the cloud asset catalog.   # (now beside the other sub-apps)

comfy nodes --help command list:

  categories  Browse the category tree.
- refresh     object_info is fetched live from the server on each command — nothing to refresh.

(comfy dependency remains hidden from the top-level list before and after; the
only difference is comfy dependency --help now shows its description, since the
retained decorator carries the help= text.)

Acceptance

  1. Each command name resolves to exactly one implementationdependency
    (one decorator), models (sub-app only), nodes refresh (gone). ✓
  2. No registered command is a silent no-op — the nodes refresh no-op is
    removed. ✓
  3. --help before/after diffed — above. ✓

Judgment calls

  • dependency kept hidden, not promoted. The two decorators disagreed
    (hidden=True vs. a visible one with help text); the effective behavior has
    always been hidden (the hidden decorator won). I deduplicated to preserve that
    effective behavior — the top-level command list is byte-identical before/after.
    Whether dependency should be a visible, documented command is a separate
    product call I did not make here.
  • nodes refresh removed, not reimplemented. The ticket allowed "make it
    actually refresh." I verified there is genuinely nothing for a manual refresh to
    do: any comfy nodes command that reaches the server already live-fetches and
    overwrites the cache (resilient_load_object_info), and the cache is only ever
    read as a fallback when the server is unreachable — a state a manual refresh
    can't fix either. So a real refresh command would still be a no-op. Removal is
    the honest fix. (The genuine "refresh object_info" capability is intact and runs
    automatically on every nodes command — nothing is being denied.)

Testing

  • ruff check + ruff format --check — clean.
  • Full test suite: 2573 passed, 37 skipped.
  • Manually verified: comfy dependency --help still works, comfy models
    resolves to the sub-app, comfy nodes refresh now returns "No such command".

…, models typo-stub, no-op nodes refresh

- dependency: collapse the two stacked @app.command decorators into one
  (hidden=True + help), so the name registers exactly one implementation.
- models: drop the hidden 'did you mean comfy model' typo-stub in cmdline.py;
  it was shadowed by the real 'models' sub-app and never reachable.
- nodes refresh: remove the honest no-op command. object_info is fetched live
  and the on-disk cache auto-refreshes on every successful 'comfy nodes'
  command via resilient_load_object_info, so a manual refresh does nothing.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 18 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e5304c37-72bc-4667-8f32-8ae4b5e1a364

📥 Commits

Reviewing files that changed from the base of the PR and between a732f5c and ed8e289.

📒 Files selected for processing (6)
  • comfy_cli/cmdline.py
  • comfy_cli/command/nodes.py
  • comfy_cli/command/run/__init__.py
  • comfy_cli/discovery.py
  • comfy_cli/skills/comfy-debug/SKILL.md
  • comfy_cli/skills/comfy/SKILL.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch matt/be-2978-dead-surface-cleanup
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch matt/be-2978-dead-surface-cleanup

Comment @coderabbitai help to get the list of available commands.

@mattmillerai mattmillerai added cursor-review Request Cursor bot review agent-coded PR authored by the agent-work loop labels Jul 14, 2026
@mattmillerai
mattmillerai marked this pull request as ready for review July 14, 2026 19:39
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 14, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

Found 1 finding(s).

Severity Count
🟠 High 1

Panel: 6/8 reviewers contributed findings.

Reviewers that did not contribute: kimi-k2.5:adversarial (empty), kimi-k2.5:edge-case (empty)

Comment thread comfy_cli/command/nodes.py
Removing the no-op `nodes refresh` command left dangling guidance pointing
users/agents at a now-nonexistent command. Since object_info is fetched live
(no cache to populate), replace each reference with the accurate remediation:

- run/__init__.py cql_no_graph hint: check cloud sign-in/connection + retry,
  or use a local server
- discovery.py COMMAND_SCHEMAS: drop the `comfy nodes refresh` entry
- comfy-debug + comfy SKILL.md: point to retry/live-fetch guidance

Raised by cursor-review (gpt-5.3-codex-xhigh edge-case).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mattmillerai

Copy link
Copy Markdown
Collaborator Author

Note for whoever merges: the red Windows Specific Commands (test-windows.yml) check is a pre-existing, repo-wide CI environment failure — it fails on every recent PR touching comfy_cli/** (last green on main was 2026-03-11). It dies at the Install Dependencies step (comfy install --fast-deps can't overwrite the already-loaded pydantic_core.*.pyd on Windows: Access is denied), before any code in this PR runs. Unrelated to this dead-surface cleanup and non-blocking (mergeStateStatus: UNSTABLE, not a required check). Worth a separate infra ticket to fix the Windows install step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-coded PR authored by the agent-work loop cursor-review Request Cursor bot review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant