Skip to content

Self-hosted workflows for coding-agent delivery. Orchestrate CodeBuddy, Codex and Claude Code with scripts and human approval gates. Includes Local workflows for coding assistants.

fix(runtime): skip CodeBuddy's built-in plugin marketplaces (#609)

Robert0622ca9325adb6be
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6adb3baa..57ed7c12 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. Loo
- Run logs and telemetry redact every environment variable ending in `_API_KEY`, `_TOKEN`, `_SECRET` or `_PASSWORD`. Agent CLI keys such as `DEEPSEEK_API_KEY`, and `AGENTFLOW_CLI_API_KEY` used with a custom Base URL, used to appear in clear text in the `docker exec` line of an SOP run log, readable by project members. Rotate a key that ran an SOP role before this release.
- Upgrading with `./start.sh pull` now re-applies the schema pieces gorm AutoMigrate cannot create: the `run_telemetry.adapter` and `run_logs.level` generated columns from `migrations/001_run_obs_generated_columns.sql`, and the `INSERT IGNORE` starter catalog. A data volume from an older release no longer fails with `Error 1054 Unknown column 'adapter'` the first time someone opens a run detail. The installer and the upgrade command share one script, `scripts/install-schema-extensions.sh`, and a failed step stops the command with the migration file an operator has to run by hand.
- Deleting a conversation removes its shared native root (`shared/<hash>`). It used to stay on disk, about 73 MB each because every root holds its own CLI home with the CodeBuddy plugin marketplace, so a scheduled task that replaces its previous run on every cycle grew the disk by one root per run. The daily session janitor also removes roots left behind earlier once their conversation is gone and they have not changed for a day.
+- CodeBuddy no longer downloads its built-in plugin marketplaces into every conversation and workspace. Each one has its own CLI home, so each new conversation used to take about 72 MB; it now takes under 1 MB. LoopForge installs no CodeBuddy plugins, and conversations that already downloaded the marketplaces keep working.
- Native conversation roots move to `AGENTFLOW_CONVERSATION_DIR`, which `compose.yaml` sets to `${LOOPFORGE_DATA_DIR}/conversations`. They used to sit in the `platform-data` volume under `/data/assistant`, a path the host Docker daemon does not have, so opening a conversation workspace on a Compose installation failed with `mkdirat ... read-only file system`. Attachments and other per-user assistant data stay in `/data/assistant`; nothing needs moving. A customised `compose.yaml` needs the same setting. `docs/deployment.md` now spells out the upgrade steps: update the checkout, then `./start.sh pull`.
- The built-in `generic-backend` Dockerfile includes `openssh-client` again, matching the platform image, so a `generic-docker` workspace or SOP sandbox starts on the platform image instead of building `agentflow-img-*` on first use. #207 added the package to the platform image but not to the starter catalog. The installer and `./start.sh pull` run `migrations/031_generic_backend_openssh.sql`, which updates the row only while it still holds the unedited previous default.
- `docs/deployment.md` splits `migrations/` into scripts the installer already covers, scripts an upgrade must run once, and scripts that only backfill existing rows.
diff --git a/internal/runtime/command_binding.go b/internal/runtime/command_binding.go
index 06e1bc1e..3739161d 100644
--- a/internal/runtime/command_binding.go
+++ b/internal/runtime/command_binding.go
@@ -46,6 +46,12 @@ func bindCommand(sandbox Sandbox, workspace string, command CommandSpec, credent
for _, key := range []string{"OPENAI_API_KEY", "CODEX_API_KEY", "OPENAI_BASE_URL", "ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN", "ANTHROPIC_BASE_URL", "CLAUDE_CODE_OAUTH_TOKEN", "CLAUDE_CODE_USE_BEDROCK", "CLAUDE_CODE_USE_VERTEX", "CLAUDE_CODE_USE_FOUNDRY"} {
bound.environment[key] = ""
}
+ if command.Provider == "codebuddy" {
+ // Every conversation and workspace gets its own CLI home, and CodeBuddy
+ // downloads its built-in plugin marketplaces (about 71 MB) into each one.
+ // LoopForge writes skills and agents itself and installs no plugins.
+ bound.environment["CODEBUDDY_SKIP_BUILTIN_MARKETPLACE"] = "1"
+ }
// Validate every private-home component before any credential binding can
// write configuration. The sandbox may have replaced a parent with a symlink.
if command.PrivateHome {
diff --git a/internal/runtime/provider_credentials_test.go b/internal/runtime/provider_credentials_test.go
index 10624bca..08de2ce6 100644
--- a/internal/runtime/provider_credentials_test.go
+++ b/internal/runtime/provider_credentials_test.go
@@ -39,6 +39,9 @@ func TestProviderCredentialBindingIsolation(t *testing.T) {
if !strings.HasPrefix(home, workspace+string(os.PathSeparator)) {
t.Fatal("provider home not isolated")
}
+ if skip := bound.environment["CODEBUDDY_SKIP_BUILTIN_MARKETPLACE"]; (kind == "codebuddy") != (skip == "1") {
+ t.Fatalf("CODEBUDDY_SKIP_BUILTIN_MARKETPLACE = %q for %s", skip, kind)
+ }
if kind == "codebuddy" {
if bound.environment["CODEBUDDY_API_KEY"] != "codebuddy-user-secret" || bound.environment["CODEBUDDY_INTERNET_ENVIRONMENT"] != "ioa" || bound.environment["CODEX_API_KEY"] != "" || bound.environment["ANTHROPIC_API_KEY"] != "" {
t.Fatal("CodeBuddy credential routing failed")