Skip to content

fix(status): match branch-qualified cache for GitHub plugins#412

Merged
christso merged 1 commit into
mainfrom
fix/status-branch-cache
May 24, 2026
Merged

fix(status): match branch-qualified cache for GitHub plugins#412
christso merged 1 commit into
mainfrom
fix/status-branch-cache

Conversation

@christso
Copy link
Copy Markdown
Contributor

Summary

  • workspace status reported ✗ not cached for any GitHub plugin whose source pins a branch (e.g. /blob/main/... or owner/repo@v1), even immediately after a successful skills add.
  • Root cause: parsePluginSource discarded the branch field returned by parseGitHubUrl, so getPluginStatus called getPluginCachePath(owner, repo) without it and looked at ~/.allagents/plugins/marketplaces/<owner>-<repo>. But fetchPlugin (src/core/plugin.ts:102,160) and seedCacheFromClone (src/core/workspace.ts:381) write to <owner>-<repo>@<branch>, so the existence check always missed.
  • Fix: add branch?: string to ParsedPluginSource, populate it in parsePluginSource, and pass it through to getPluginCachePath in getPluginStatus. No other call sites needed changes — they already pass branch directly.

Repro (before)

$ npx allagents skills add https://github.com/NousResearch/hermes-agent/blob/main/skills/research/llm-wiki
✓ Enabled skill: llm-wiki (llm-wiki)
$ npx allagents workspace status
Project Plugins (1):
  ✗ https://github.com/.../llm-wiki (not cached)

After the fix, the same command reports ✓ ... (cached).

Test plan

  • bun test tests/unit/utils/plugin-path.test.ts tests/unit/core/status-both-scopes.test.ts — added one test for parsePluginSource returning branch from a /blob/ URL, one for owner/repo@ref shorthand, and one regression test asserting status reports available: true against a branch-qualified cache dir.
  • bun test — full suite (1285 pass, 4 skip, 0 fail).
  • bun run typecheck — clean.
  • End-to-end: built CLI against an existing workspace with a /blob/main/... source — status flipped from ✗ not cached to ✓ cached.

🤖 Generated with Claude Code

`workspace status` looked up plugin caches by `<owner>-<repo>`, but
`fetchPlugin`/`seedCacheFromClone` write to `<owner>-<repo>@<branch>`
whenever the source URL pins a branch (e.g. /blob/main/...). The
result was a false "not cached" right after a successful `skills add`.

Plumb the parsed branch through `ParsedPluginSource` so `getPluginStatus`
calls `getPluginCachePath` with the same branch the fetcher used.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1340700
Status: ✅  Deploy successful!
Preview URL: https://8e59c2e4.allagents.pages.dev
Branch Preview URL: https://fix-status-branch-cache.allagents.pages.dev

View logs

@christso
Copy link
Copy Markdown
Contributor Author

E2E verification log

Fresh temp dir, same commands the user originally ran. Same cache state for both runs — only the CLI binary changes.

Setup

$ REPRO=$(mktemp -d -t ux-verify-XXXXXX)
$ cd "$REPRO"

$ npx -y allagents@1.11.9 workspace init . --client claude
✓ Workspace created at: /tmp/ux-verify-cBroAT

Syncing plugins...

$ npx -y allagents@1.11.9 skills add https://github.com/NousResearch/hermes-agent/blob/main/skills/research/llm-wiki
Installing skill 'llm-wiki' from https://github.com/NousResearch/hermes-agent/blob/main/skills/research/llm-wiki...
✓ Enabled skill: llm-wiki (llm-wiki)

.allagents/workspace.yaml:

repositories: []
plugins:
  - source: https://github.com/NousResearch/hermes-agent/blob/main/skills/research/llm-wiki
    skills:
      - llm-wiki
clients:
  - claude
version: 2

Cache on disk (note the @main suffix written by the fetcher):

$ ls -d ~/.allagents/plugins/marketplaces/NousResearch*
/home/entity/.allagents/plugins/marketplaces/NousResearch-hermes-agent@main

Before (allagents@1.11.9 from npm)

$ npx -y allagents@1.11.9 workspace status
Project Plugins (1):
  ✗ https://github.com/NousResearch/hermes-agent/blob/main/skills/research/llm-wiki (not cached)

User Plugins (0):
  No user plugins configured

Clients (1):
  claude

After (this PR's build)

$ node /path/to/dist/index.js workspace status
Project Plugins (1):
  ✓ https://github.com/NousResearch/hermes-agent/blob/main/skills/research/llm-wiki (cached)

User Plugins (0):
  No user plugins configured

Clients (1):
  claude

Only the ✗ ... (not cached)✓ ... (cached) line changes — everything else (header counts, indentation, client list) is byte-identical.

@christso christso merged commit 6449647 into main May 24, 2026
1 check passed
@christso christso deleted the fix/status-branch-cache branch May 24, 2026 23:41
christso added a commit that referenced this pull request May 25, 2026
- Add formatPluginSource() helper that shortens GitHub URLs to OWNER/REPO,
  strips /blob/<default-branch>/, and preserves @<ref> for non-default refs.
  Used by `workspace status` and `skill list` output (display-only — the
  workspace.yaml source is preserved verbatim).
- Recursively walk skills/ to find every SKILL.md, including nested layouts
  like skills/research/llm-wiki/SKILL.md. Each discovered skill carries its
  qualified subpath alongside the bare leaf name; the allowlist now matches
  either form so users can disambiguate with `category/skill` if needed.
  As a side effect, `skill add --list` no longer reports container dirs
  that lack a SKILL.md as fake skills.
- Add npx-skills positional shape: when the positional argument to
  `skill add` looks like a GitHub source AND a selector (--skill, --list,
  --all) is provided, treat the positional as the source. Adds a --skill
  flag that accepts a comma-separated list for multi-skill installs.
  The legacy `--from`/deep-URL forms continue to work unchanged.
- Update transform.copySkills() and collectPluginSkills() to use the same
  recursive walk so sync correctly copies nested skills referenced by the
  allowlist.

Builds on #412.
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