Skip to content

fix: drop clawhub: prefix from plugin install commands#214

Merged
xcoulon merged 1 commit into
codeready-toolchain:masterfrom
xcoulon:init-plugins
Jun 25, 2026
Merged

fix: drop clawhub: prefix from plugin install commands#214
xcoulon merged 1 commit into
codeready-toolchain:masterfrom
xcoulon:init-plugins

Conversation

@xcoulon

@xcoulon xcoulon commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

The openclaw plugins install has issues with the clawhub:
registry prefix, it seems to ignore the version suffix and always
uses the latest version instead of the one specified in the plugin spec.

Resolving clawhub:@openclaw/anthropic-vertex-provider@2026.6.9…
Plugin "@openclaw/anthropic-vertex-provider" requires plugin API >=2026.6.10, butthis OpenClaw runtime exposes 2026.6.9.
command terminated with exit code 1

Remove it from the generated init container script,
update the API doc comment and CRD description, and adjust all related
tests accordingly.

Assisted-by: Claude Opus 4.6 (1M context)
Signed-off-by: Xavier Coulon xcoulon@redhat.com

Summary by CodeRabbit

  • Bug Fixes
    • Updated plugin installation behavior to use the plugin spec directly, improving how configured plugins are installed during startup.
    • Fixed quoting and escaping for plugin names, including names with special characters.
  • Documentation
    • Aligned plugin installation examples and schema text with the current command format.

The `openclaw plugins install` has issues with the `clawhub:`
registry prefix, it seems to ignore the version suffix and always
uses the latest version instead of the one specified in the plugin spec.

```
Resolving clawhub:@openclaw/anthropic-vertex-provider@2026.6.9…
Plugin "@openclaw/anthropic-vertex-provider" requires plugin API >=2026.6.10, butthis OpenClaw runtime exposes 2026.6.9.
command terminated with exit code 1
```

Remove it from the generated init container script,
update the API doc comment and CRD description, and adjust all related
tests accordingly.

Assisted-by: Claude Opus 4.6 (1M context)
Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Walkthrough

Removes the clawhub: prefix from the openclaw plugins install command in the controller's plugin script generator (generatePluginInstallScript), and updates the corresponding API type comment, CRD schema description, and all unit and integration test assertions to match the new command format.

Changes

Drop clawhub: prefix from plugin install command

Layer / File(s) Summary
Controller script and API/CRD documentation
internal/controller/claw_plugins.go, api/v1alpha1/claw_types.go, config/crd/bases/claw.sandbox.redhat.com_claws.yaml
generatePluginInstallScript now emits openclaw plugins install %s instead of openclaw plugins install clawhub:%s. The API type comment and CRD schema description are updated to show the same command format.
Test assertions
internal/controller/claw_plugins_test.go
Unit tests for TestGeneratePluginInstallScript and TestConfigurePluginsInitContainer, plus integration tests, now assert openclaw plugins install '@<plugin>' (without clawhub:) for single-plugin, multi-plugin, and single-quote escaping cases.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

bug, documentation, test

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the clawhub: prefix from plugin install commands.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot added bug Something isn't working documentation Improvements or additions to documentation test Work that adds, fixes, or maintains automated tests or coverage (unit, integration, e2e, flakiness) labels Jun 24, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/controller/claw_plugins.go`:
- Around line 117-119: The plugin install command format in claw plugin
generation has changed, so update the stale examples to match the new output
from claw_plugins.go’s install command builder. Align the documented install
syntax in the user guide and the configmap manifest examples with the generated
openclaw plugins install <pkg> form, keeping the docs consistent with the
behavior of the plugin list/install code path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: a7fb24f1-502f-4ef4-a4bd-e7a821d69272

📥 Commits

Reviewing files that changed from the base of the PR and between 50a16e0 and 4729f21.

📒 Files selected for processing (4)
  • api/v1alpha1/claw_types.go
  • config/crd/bases/claw.sandbox.redhat.com_claws.yaml
  • internal/controller/claw_plugins.go
  • internal/controller/claw_plugins_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • codeready-toolchain/api (manual)
  • codeready-toolchain/toolchain-common (manual)
  • codeready-toolchain/host-operator (manual)
  • codeready-toolchain/toolchain-e2e (manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests
🧰 Additional context used
📓 Path-based instructions (5)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • config/crd/bases/claw.sandbox.redhat.com_claws.yaml
  • api/v1alpha1/claw_types.go
  • internal/controller/claw_plugins.go
  • internal/controller/claw_plugins_test.go
api/v1alpha1/**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

Modify API types in api/v1alpha1/ and run make manifests to regenerate CRD YAML in config/crd/bases/ and make generate to regenerate zz_generated.deepcopy.go

Files:

  • api/v1alpha1/claw_types.go
**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.go: Include Go license header from hack/boilerplate.go.txt template in all Go source files
Run golangci-lint via make lint and use make lint-fix for auto-fixing, with .golangci.yml configuration including lll and dupl linters enabled
Use make fmt (go fmt) and make vet (go vet) for code formatting and vetting before committing

Files:

  • api/v1alpha1/claw_types.go
  • internal/controller/claw_plugins.go
  • internal/controller/claw_plugins_test.go
internal/controller/**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

Set owner references on all created resources via controllerutil.SetControllerReference

Files:

  • internal/controller/claw_plugins.go
  • internal/controller/claw_plugins_test.go
**/*_test.go

📄 CodeRabbit inference engine (CLAUDE.md)

**/*_test.go: Use require assertion from testify for fatal setup errors in tests, and assert for value comparisons
Structure tests with Test* function names, use t.Run() for subtests, t.Cleanup() for cleanup, and implement table-driven test patterns
Use waitFor(t, timeout, interval, condition, message) helper for async test assertions with 10s timeout and 250ms poll interval
Create separate test files per resource type (e.g., claw_configmap_test.go, claw_credentials_test.go)

Files:

  • internal/controller/claw_plugins_test.go
🔇 Additional comments (4)
internal/controller/claw_plugins.go (1)

93-124: LGTM!

api/v1alpha1/claw_types.go (1)

544-548: LGTM!

config/crd/bases/claw.sandbox.redhat.com_claws.yaml (1)

747-754: LGTM!

internal/controller/claw_plugins_test.go (1)

117-130: LGTM!

Also applies to: 199-202, 328-343, 624-628, 696-700

Comment on lines 117 to +119
for _, pkg := range plugins {
escaped := "'" + strings.ReplaceAll(pkg, "'", "'\\''") + "'"
fmt.Fprintf(&b, "openclaw plugins install clawhub:%s\n", escaped)
fmt.Fprintf(&b, "openclaw plugins install %s\n", escaped)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find any remaining references to the old clawhub: install form
rg -n "plugins install clawhub:" --hidden -g '!**/vendor/**'

Repository: codeready-toolchain/claw-operator

Length of output: 171


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n-- matches for old form --\n'
rg -n "plugins install clawhub:" --hidden -g '!**/vendor/**' || true

printf '\n-- matches for generated command and related docs --\n'
rg -n "openclaw plugins install|clawhub:" internal/assets/manifests/claw/configmap.yaml docs/user-guide.md internal/controller/claw_plugins.go || true

printf '\n-- relevant file excerpts --\n'
sed -n '110,125p' internal/controller/claw_plugins.go
echo
sed -n '1110,1130p' internal/assets/manifests/claw/configmap.yaml
echo
sed -n '1640,1660p' docs/user-guide.md

Repository: codeready-toolchain/claw-operator

Length of output: 199


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n-- clawhub references --\n'
rg -n "clawhub:" internal/assets/manifests/claw/configmap.yaml docs/user-guide.md internal/controller/claw_plugins.go || true

printf '\n-- install command references --\n'
rg -n "openclaw plugins install|plugins install" internal/assets/manifests/claw/configmap.yaml docs/user-guide.md internal/controller/claw_plugins.go || true

Repository: codeready-toolchain/claw-operator

Length of output: 1389


Update the stale plugin install docs. internal/controller/claw_plugins.go now emits openclaw plugins install <pkg>, but docs/user-guide.md:1646 and internal/assets/manifests/claw/configmap.yaml:1120 still document clawhub:<pkg>. Keep those examples aligned with the generated command.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/claw_plugins.go` around lines 117 - 119, The plugin
install command format in claw plugin generation has changed, so update the
stale examples to match the new output from claw_plugins.go’s install command
builder. Align the documented install syntax in the user guide and the configmap
manifest examples with the generated openclaw plugins install <pkg> form,
keeping the docs consistent with the behavior of the plugin list/install code
path.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.97%. Comparing base (50a16e0) to head (4729f21).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #214   +/-   ##
=======================================
  Coverage   78.97%   78.97%           
=======================================
  Files          32       32           
  Lines        4176     4176           
=======================================
  Hits         3298     3298           
  Misses        562      562           
  Partials      316      316           
Files with missing lines Coverage Δ
internal/controller/claw_plugins.go 93.05% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xcoulon xcoulon merged commit 8da980c into codeready-toolchain:master Jun 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation test Work that adds, fixes, or maintains automated tests or coverage (unit, integration, e2e, flakiness)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants