Skip to content

feat: cog playground#3115

Open
anish-sahoo wants to merge 4 commits into
mainfrom
cog-playground
Open

feat: cog playground#3115
anish-sahoo wants to merge 4 commits into
mainfrom
cog-playground

Conversation

@anish-sahoo

@anish-sahoo anish-sahoo commented Jul 14, 2026

Copy link
Copy Markdown
Member

* feat: add Go playground server

* fix: strip protocol-relative playground redirects

* fix: strip all playground proxy redirects
@anish-sahoo anish-sahoo requested a review from a team as a code owner July 14, 2026 21:39
@ask-bonk

ask-bonk Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

I found one critical issue in this PR:

newPlaygroundCommand() is never registered in pkg/cli/root.go.

The cog playground command is fully implemented in pkg/cli/playground.go, but it is never added to the root command, so users will see ``unknown command" when they run cog playground.

Fix:

// pkg/cli/root.go
rootCmd.AddCommand(
    newBuildCommand(),
    newDebugCommand(),
    newDoctorCommand(),
    newInitCommand(),
    newLoginCommand(),
    newRunCommand(),
    newPredictCommand(),
    newPushCommand(),
    newExecCommand(),
    newServeCommand(),
    newTrainCommand(),
    newWeightsCommand(),
    newPlaygroundCommand(),  // <-- add this
)

@ask-bonk

ask-bonk Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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

This PR adds a cog playground command with a browser-based UI for interacting with running Cog models, plus the frontend scaffold, CI integration, and build pipeline changes. Overall the implementation is solid — the Go server has good security boundaries (loopback-only UI, webhook exemption for containers, CORS-safe proxying, CSP headers) and thorough test coverage.

I found one critical issue that prevents the command from being usable at all:

newPlaygroundCommand() is never registered in pkg/cli/root.go.

The command is fully implemented in pkg/cli/playground.go but is never added to rootCmd.AddCommand(), so cog playground will return "unknown command".

Posted the fix as a PR comment: #3115 (comment)

github run

@ask-bonk

ask-bonk Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

I found one critical issue in this PR:

newPlaygroundCommand() is never registered in pkg/cli/root.go.

The cog playground command is fully implemented in pkg/cli/playground.go, but it is never added to the root command, so users will see "unknown command" when they run cog playground.

Fix:

// pkg/cli/root.go
rootCmd.AddCommand(
    newBuildCommand(),
    newDebugCommand(),
    newDoctorCommand(),
    newInitCommand(),
    newLoginCommand(),
    newRunCommand(),
    newPredictCommand(),
    newPushCommand(),
    newExecCommand(),
    newServeCommand(),
    newTrainCommand(),
    newWeightsCommand(),
    newPlaygroundCommand(),  // <-- add this
)

@ask-bonk

ask-bonk Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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

This PR adds a cog playground command with a browser-based UI for interacting with running Cog models, plus the frontend scaffold, CI integration, and build pipeline changes. The Go server has good security boundaries (loopback-only UI, webhook exemption for containers, CORS-safe proxying, CSP headers) and thorough test coverage.

I found one critical issue that prevents the command from being usable at all:

newPlaygroundCommand() is never registered in pkg/cli/root.go.

The command is fully implemented in pkg/cli/playground.go but is never added to rootCmd.AddCommand(), so cog playground will return "unknown command".

Posted the fix as a PR comment: #3115 (comment)

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