Skip to content

Add experimental warning to weights commands#3025

Open
michaeldwan wants to merge 1 commit into
mainfrom
md/weights-warning
Open

Add experimental warning to weights commands#3025
michaeldwan wants to merge 1 commit into
mainfrom
md/weights-warning

Conversation

@michaeldwan
Copy link
Copy Markdown
Member

Weights are being used internally and referenced publicly, but the feature is still a WIP. Any cog weights subcommand now prints a warning before execution, matching the pattern cog doctor uses:

NOTE: cog weights is experimental. Behavior may change in future versions.
Do not rely on it in production workflows.

Uses PersistentPreRun on the weights parent command so all subcommands (import, pull, status) get it automatically. Also updated the help text.

@michaeldwan michaeldwan requested a review from a team as a code owner May 19, 2026 23:21
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 19, 2026

I'm Bonk, and I've done a quick review of your PR.

This PR adds an experimental warning to all cog weights subcommands using PersistentPreRun with proper parent chaining, matching the pattern established by cog doctor.

1 issue found:

  1. Missing warning when run with --help (medium): The warning prints during command execution, but if a user runs cog weights --help, they'll see the experimental notice in the Long description but won't see the runtime warning. This is actually consistent with cog doctor behavior, so this may be intentional. However, consider that users might not realize it's experimental if they only ever use --help.

The implementation correctly chains the parent's PersistentPreRun, ensuring root-level setup (debug, color, update checks) still runs. The help text is properly updated with the experimental notice.

LGTM

The PR correctly implements the experimental warning pattern. The implementation is solid and follows the established convention from cog doctor. The warning is displayed via PersistentPreRun with proper parent command chaining, ensuring it appears for all subcommands (import, pull, status) while preserving the root command's initialization logic.

github run

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