From 021e0037b633cac12edf79a660239540eca6c5c8 Mon Sep 17 00:00:00 2001 From: Willie Date: Sun, 4 Oct 2026 22:14:28 +0800 Subject: [PATCH 1/3] fix(plugin): expect the version Codex reads from a portable manifest Codex 0.159 installs from a portable root plugin.json (agent-plugins.org schema) ahead of .codex-plugin/plugin.json, and reports 1.0.0 when that manifest has no version. Skillshare preferred .codex-plugin/plugin.json, so updating a package that ships both (ponytail 4.10.3) failed with "native update returned version 1.0.0; expected 4.10.3" on every sync. --- internal/plugin/source_compat_test.go | 10 ++++++---- internal/plugin/source_manifest.go | 6 ++++-- website/docs/reference/commands/plugin.md | 4 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/internal/plugin/source_compat_test.go b/internal/plugin/source_compat_test.go index ce95ecc4b..41d185ce1 100644 --- a/internal/plugin/source_compat_test.go +++ b/internal/plugin/source_compat_test.go @@ -112,15 +112,17 @@ func TestDroidPluginTargetNotSupported(t *testing.T) { } } -func TestNativeManifestPrecedesPortableFallback(t *testing.T) { +// Codex 0.159 installs from a portable root plugin.json ahead of .codex-plugin/plugin.json, so +// its version is what Codex reports after an update. +func TestCodexPortableManifestPrecedesNative(t *testing.T) { root := fixture(t) - writeFile(t, root, "plugin.json", `{"$schema":"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json","name":"demo","version":"old"}`) + writeFile(t, root, "plugin.json", `{"$schema":"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json","name":"demo","version":"portable"}`) d, err := Discover(context.Background(), root) if err != nil { t.Fatal(err) } - if d.Candidates[0].TargetInfo["codex"].Manifest != ".codex-plugin/plugin.json" { - t.Fatal("portable fallback hid native manifest") + if info := d.Candidates[0].TargetInfo["codex"]; info.Manifest != "plugin.json" || info.Version != "portable" { + t.Fatalf("Codex manifest: %+v", info) } writeFile(t, root, "plugin.json", "{") d, err = Discover(context.Background(), root) diff --git a/internal/plugin/source_manifest.go b/internal/plugin/source_manifest.go index e6f7793fd..04a606388 100644 --- a/internal/plugin/source_manifest.go +++ b/internal/plugin/source_manifest.go @@ -117,8 +117,10 @@ func inspect(root string, explicit ...string) (Candidate, error) { } info.Components = manifestComponents(root, spec.target, m, info.Components) } - // The first native manifest wins; explicit invalid manifests remain errors. - if _, exists := c.TargetInfo[spec.target]; !exists { + // The first native manifest wins; explicit invalid manifests remain errors. Codex is the + // exception: it installs from a portable root plugin.json ahead of .codex-plugin/plugin.json, + // and reports 1.0.0 when that manifest has no version. + if _, exists := c.TargetInfo[spec.target]; !exists || spec.path == "plugin.json" && spec.target == "codex" && info.Problem == "" { c.TargetInfo[spec.target] = info } if spec.path == "plugin.json" && spec.target == "codex" { diff --git a/website/docs/reference/commands/plugin.md b/website/docs/reference/commands/plugin.md index 734298c40..2e306399c 100644 --- a/website/docs/reference/commands/plugin.md +++ b/website/docs/reference/commands/plugin.md @@ -326,7 +326,9 @@ never supplies native trust approval flags. - Claude requires its native `.claude-plugin/plugin.json` package. - Codex accepts `.codex-plugin/plugin.json` and recognized portable root - `plugin.json` packages. A Claude-only package is not silently converted. + `plugin.json` packages. When a package has both, Codex installs from the portable + root `plugin.json`, so Skillshare expects that manifest's version. + A Claude-only package is not silently converted. - Sources may contain a marketplace with local plugin entries. External catalog catalogs are merged by plugin name/path. Conflicting paths are rejected; external entries are reported with instructions to add their repository directly or From 04c4c95cbae698911d0be49f22db6d8f5a5e2beb Mon Sep 17 00:00:00 2001 From: Willie Date: Sun, 4 Oct 2026 22:18:57 +0800 Subject: [PATCH 2/3] fix(plugin): keep version check for versionless portable manifests A portable root plugin.json without a version left the Codex binding's version empty, which skips the post-update version check, so an update could advance the snapshot while Codex still ran an older copy. Codex reports 1.0.0 for such a manifest, so expect that instead. Refs Codex review on #396. --- internal/plugin/source_compat_test.go | 17 +++++++++++++++++ internal/plugin/source_manifest.go | 4 ++++ website/docs/reference/commands/plugin.md | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/internal/plugin/source_compat_test.go b/internal/plugin/source_compat_test.go index 41d185ce1..3b9deeb01 100644 --- a/internal/plugin/source_compat_test.go +++ b/internal/plugin/source_compat_test.go @@ -131,6 +131,23 @@ func TestCodexPortableManifestPrecedesNative(t *testing.T) { } } +// Codex reports 1.0.0 for a portable manifest without a version; expecting it keeps the +// post-update version check instead of skipping it. +func TestCodexExpectsDefaultVersionOfVersionlessPortableManifest(t *testing.T) { + root := t.TempDir() + writeFile(t, root, "plugin.json", `{"$schema":"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json","name":"demo"}`) + d, err := Discover(context.Background(), root) + if err != nil { + t.Fatal(err) + } + if got := d.Candidates[0].TargetInfo["codex"].Version; got != "1.0.0" { + t.Fatalf("Codex version = %q, want 1.0.0", got) + } + if got := d.Candidates[0].TargetInfo["cursor"].Version; got != "" { + t.Fatalf("cursor version = %q, want none", got) + } +} + func TestCodexLogoComesFromTheManifestInsideThePlugin(t *testing.T) { root := fixture(t) writeFile(t, root, ".codex-plugin/plugin.json", `{"name":"demo","version":"1.0.0","skills":"./skills","interface":{"logo":"./logo.png"}}`) diff --git a/internal/plugin/source_manifest.go b/internal/plugin/source_manifest.go index 04a606388..6466735ff 100644 --- a/internal/plugin/source_manifest.go +++ b/internal/plugin/source_manifest.go @@ -129,6 +129,10 @@ func inspect(root string, explicit ...string) (Candidate, error) { c.TargetInfo[target] = info } } + if codex := c.TargetInfo["codex"]; codex.Manifest == "plugin.json" && codex.Version == "" { + codex.Version = "1.0.0" + c.TargetInfo["codex"] = codex + } } } if info, ok := c.TargetInfo["claude"]; ok && info.Problem == "" { diff --git a/website/docs/reference/commands/plugin.md b/website/docs/reference/commands/plugin.md index 2e306399c..d82fecae5 100644 --- a/website/docs/reference/commands/plugin.md +++ b/website/docs/reference/commands/plugin.md @@ -327,7 +327,8 @@ never supplies native trust approval flags. - Claude requires its native `.claude-plugin/plugin.json` package. - Codex accepts `.codex-plugin/plugin.json` and recognized portable root `plugin.json` packages. When a package has both, Codex installs from the portable - root `plugin.json`, so Skillshare expects that manifest's version. + root `plugin.json`, so Skillshare expects that manifest's version, or `1.0.0` + when it has none. A Claude-only package is not silently converted. - Sources may contain a marketplace with local plugin entries. External catalog catalogs are merged by plugin name/path. Conflicting paths are rejected; external From f5a24702763a1ba5fc05faa4cb1ea55b5731f8da Mon Sep 17 00:00:00 2001 From: Willie Date: Sun, 4 Oct 2026 22:24:12 +0800 Subject: [PATCH 3/3] fix(plugin): keep the Codex logo under a portable manifest Adopting the portable root plugin.json replaced the whole Codex target info, dropping the interface.logo read from .codex-plugin/plugin.json. Codex still overlays that native manifest, and the portable one rarely names a logo, so the add/list UI fell back to a generic icon. Refs Codex review on #396. --- internal/plugin/source_compat_test.go | 15 +++++++++++++++ internal/plugin/source_manifest.go | 13 ++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/internal/plugin/source_compat_test.go b/internal/plugin/source_compat_test.go index 3b9deeb01..14e4d5605 100644 --- a/internal/plugin/source_compat_test.go +++ b/internal/plugin/source_compat_test.go @@ -148,6 +148,21 @@ func TestCodexExpectsDefaultVersionOfVersionlessPortableManifest(t *testing.T) { } } +// Codex overlays .codex-plugin/plugin.json on a portable manifest, so its logo still applies. +func TestCodexKeepsNativeLogoUnderPortableManifest(t *testing.T) { + root := fixture(t) + writeFile(t, root, ".codex-plugin/plugin.json", `{"name":"demo","version":"1.0.0","skills":"./skills","interface":{"logo":"./logo.png"}}`) + writeFile(t, root, "logo.png", "png-bytes") + writeFile(t, root, "plugin.json", `{"$schema":"https://agent-plugins.org/schemas/1.0.0/plugin.schema.json","name":"demo"}`) + d, err := Discover(context.Background(), root) + if err != nil { + t.Fatal(err) + } + if got := d.Candidates[0].TargetInfo["codex"].Logo; got != "data:image/png;base64,cG5nLWJ5dGVz" { + t.Fatalf("native logo lost: %q", got) + } +} + func TestCodexLogoComesFromTheManifestInsideThePlugin(t *testing.T) { root := fixture(t) writeFile(t, root, ".codex-plugin/plugin.json", `{"name":"demo","version":"1.0.0","skills":"./skills","interface":{"logo":"./logo.png"}}`) diff --git a/internal/plugin/source_manifest.go b/internal/plugin/source_manifest.go index 6466735ff..e28a5c417 100644 --- a/internal/plugin/source_manifest.go +++ b/internal/plugin/source_manifest.go @@ -120,7 +120,8 @@ func inspect(root string, explicit ...string) (Candidate, error) { // The first native manifest wins; explicit invalid manifests remain errors. Codex is the // exception: it installs from a portable root plugin.json ahead of .codex-plugin/plugin.json, // and reports 1.0.0 when that manifest has no version. - if _, exists := c.TargetInfo[spec.target]; !exists || spec.path == "plugin.json" && spec.target == "codex" && info.Problem == "" { + native, exists := c.TargetInfo[spec.target] + if !exists || spec.path == "plugin.json" && spec.target == "codex" && info.Problem == "" { c.TargetInfo[spec.target] = info } if spec.path == "plugin.json" && spec.target == "codex" { @@ -129,8 +130,14 @@ func inspect(root string, explicit ...string) (Candidate, error) { c.TargetInfo[target] = info } } - if codex := c.TargetInfo["codex"]; codex.Manifest == "plugin.json" && codex.Version == "" { - codex.Version = "1.0.0" + if codex := c.TargetInfo["codex"]; codex.Manifest == "plugin.json" { + // .codex-plugin/plugin.json still overlays the portable manifest, so keep its logo. + if codex.Logo == "" { + codex.Logo = native.Logo + } + if codex.Version == "" { + codex.Version = "1.0.0" + } c.TargetInfo["codex"] = codex } }