Skip to content

Agents synced via an agent extension always show as drift (0/N) in status, doctor and Sync tab #391

Closed

Description

@danscheer

Problem

Agents synced through an agent target extension are always reported as out of sync. skillshare status shows 0/2 for the target, status --json reports "linked": 0, "drift": true, and the agents stay listed as pending in the Web UI Sync tab. Running sync again (also with force) does not change this.

The sync itself works: the converted files are written correctly, and their hashes match .skillshare-manifest.json. Only the status count is wrong.

Reproduction

skillshare v0.24.3, macOS.

  1. Two agents in ~/.config/skillshare/agents/: reviewer.md and svelte-file-editor.md.

  2. A target with an agent extension. The extension is a copy of the reference extensions/codex-agents with an extra field mapping; output_ext: toml is unchanged.

    targets:
      codex:
        skills:
          path: ~/.codex/skills
          enabled: false
        agents:
          path: ~/.codex/agents
          extension: codex-agents-mapped
  3. skillshare sync agents:

    ✓ codex      2 copied
    ✓ Synced 2 agents to 2 targets
    
  4. ~/.codex/agents/ now contains reviewer.toml, svelte-file-editor.toml and .skillshare-manifest.json. The manifest tracks reviewer.toml and svelte-file-editor.toml, and the SHA-256 of both files matches the manifest.

  5. skillshare status:

    Targets                        skills        agents
      codex      ~/.codex/skills     skills off  ! 0/2
    

    skillshare status --json:

    { "name": "codex", "path": "/Users/me/.codex/agents", "expected": 2, "linked": 0, "drift": true }

Expected

2/2, "drift": false, and nothing pending in the Sync tab once the converted files are up to date.

Cause

SyncedAgentCopies looks for the copy under the source file name and compares it byte for byte with the source — internal/sync/agent_sync.go:270-288:

if _, tracked := copies.m.Managed[a.FlatName]; !tracked {   // looks up "reviewer.md"
...
target := filepath.Join(targetDir, a.FlatName)               // expects <target>/reviewer.md
if ... contentEqual(a.AbsPath, target) {                     // expects source content

With an extension, the file is written under output_ext (reviewer.toml), the manifest key is reviewer.toml, and the content is the converted output. So none of the three checks can match, and every extension-converted agent counts as missing.

The same function feeds the agent count in:

From the code, this should affect every agent extension that changes the file name or content, including the built-in codex-agents and opencode-agents. I only reproduced it with my copy of codex-agents.

Possible fix

For targets with an extension, count an agent as synced when the manifest tracks <stem>.<output_ext> and the file's hash matches the manifest entry, instead of comparing against the source file.

Activity

  1. self-assigned this
    on Oct 4, 2026
  2. added
    bug
    on Oct 4, 2026
  3. runkids commented on Oct 4, 2026

    @runkids
    Owner

    Thanks for the detailed report and the pointer to SyncedAgentCopies, that was exactly it.

    Fix is in #392: for a target with an extension, an agent now counts as synced when the manifest tracks its converted output and the file still matches the recorded hash, so status, doctor and the Sync tab report 2/2 after a sync. It affects the built-in codex-agents and opencode-agents too, as you suspected.

    It will go out in the next patch release. I'll post here once it is published so you can confirm on your setup.

  4. added
    awaiting-reply
    on Oct 4, 2026
  5. runkids commented on Oct 5, 2026

    @runkids
    Owner

    @danscheer The fix is now available in v0.24.5.

    Could you update and confirm that status, doctor and the Sync tab no longer report drift for the converted agents on your setup?

  6. danscheer commented on Oct 5, 2026

    @danscheer
    Author

    That was fast, thanks! I updated to v0.24.5 and status, status --json ("linked": 2, "drift": false) and doctor (2/2 linked) all look right now.

    One spot still seems to be missing it: the Sync tab keeps listing both agents as pending. skillshare diff shows the same thing:

    codex
      New       reviewer.md, svelte-file-editor.md
    

    and GET /api/diff returns {"skill":"reviewer.md","action":"link","reason":"source only","kind":"agent"} for both agents.

    From a quick look, computeAgentTargetDiff (internal/server/handler_agent_diff.go) and computeAgentDiff (cmd/skillshare/diff_agents.go) still only scan for *.md files under the source name. So they miss the extension's output_ext and the manifest that #392 now checks in SyncedAgentCopies.

    Happy to test again once that's in.

  7. reopened this on Oct 5, 2026
  8. runkids commented on Oct 5, 2026

    @runkids
    Owner

    @danscheer Thanks for the follow-up, the Sync tab and skillshare diff were still missing it. That is fixed in v0.24.6: both now treat a converted agent as synced after a sync, list it again when the source changes, and follow the target's include/exclude.

    Could you update and confirm that skillshare diff and the Sync tab no longer list the two agents on your setup?

  9. danscheer commented on Oct 5, 2026

    @danscheer
    Author

    Updated to v0.24.6 and everything checks out:

    • skillshare diff no longer lists reviewer.md / svelte-file-editor.md for codex
    • the Sync tab shows nothing pending anymore
    • status and doctor still report 2/2

    Thanks for the quick turnaround on both fixes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

awaiting-replybug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions