Without file-link privilege (Windows without Developer Mode) merge mode
copies agents and tracks the copies it wrote. A file a tool already had
with the same bytes as the source was not tracked, so it was kept, and
--force kept it too: the identical-content check ran before the force
check. init's "kept local agents: X (sync agents --force replaces them)"
then named a file --force could never take over, on every run.
With --force the file is now recorded as skillshare's, so later syncs
update it. Without --force nothing changes.
Also: the five-name cap written twice is one helper, sync.ListNames,
and doctor.md says when a recorded broken link is reported as a broken
symlink (the behavior from #942).
Three previews disagreed with what sync does to a link no skill or
agent maps to.
The agent diff, in the CLI and the dashboard, listed every orphan link
as a removal. Agent sync prunes a link only in merge mode, and only when
it is broken or points into the source, so a live link to another
location was listed forever. Both diffs now ask the function prune uses.
The CLI diff listed no orphan links at all for merge-mode skills, so a
skill removed from the source showed nothing until sync pruned its
link. It now lists the links sync.OrphanLink says prune removes.
doctor called a broken link "did not create, kept" whenever OwnsLink was
false. Prune also removes a broken link under a name the manifest
records in any form once no skill maps to it, so doctor told the user to
delete by hand a link that sync removes. It now reports those as broken
and suggests sync. An empty source counts as "every entry is an orphan";
only a failed discovery turns the check off.
Closes#939Closes#940Closes#941
Extension outputs were matched to an agent by stem alone. A plain copy
that sync tracked before the target enabled an extension (reviewer.md)
passed for the converted output, so status, doctor, diff and the Sync tab
reported the target in sync while the next sync would write reviewer.toml
and prune the copy.
Only a transform records a source fingerprint, so an output without one
is no longer counted as converted. Outputs written before fingerprints
existed (before 0.24.5) show as pending until the next sync, which is
what they were already reported as before #392.
Refs #415
* fix(diff): compare extension agent outputs and apply target filters
#392 taught status and doctor to recognise converted extension outputs,
but diff (CLI) and the Sync tab (/api/diff) still compared the target
directory's *.md files against the source name. A target whose extension
renames the output (codex -> .toml) therefore listed every agent as
pending after a sync.
Both diff paths now use the same manifest-based check as status, and
report tracked outputs whose source is gone as prune items. They also
apply the target's include/exclude and the agents' frontmatter targets,
so an agent that sync would skip is no longer shown as pending.
Refs #391
* chore(release): request 0.24.6
The pending feat commits would make Release Please propose 0.25.0. This
batch is meant to ship as the 0.24.6 patch, so ask for that version.
Release-As: 0.24.6
Two agents that flatten to the same name matched the same manifest entry
and were both counted, so status could report 2/2 with one output on
disk. Each manifest key now satisfies one agent.
Refs Codex review on #392.
Counting an extension output as synced from its output hash alone missed
the common case: the user edits the agent in the source and runs status
to see whether a sync is due. The output still matched the manifest, so
status, doctor and the dashboard reported no drift although the next
sync would regenerate it.
Sync now records a SHA-256 of the source each output was converted from
in the manifest (sources), and status counts an output only when both
the output and that fingerprint are current. Outputs recorded by earlier
releases have no fingerprint and count as current until the next sync
records one, so upgrading does not show the 0/N the report was about.
Refs #391, Codex review on #392.
An agent target with an extension writes each agent under output_ext
(reviewer.toml) with transformed content, and the manifest tracks that
output name. status, doctor and the dashboard's Sync tab counted synced
agents by looking for the source name and comparing with the source
content, so every converted agent was missing: status showed 0/N with
drift, doctor said the same, and the Sync tab kept them pending after a
successful sync.
For an extension target, count an agent as synced when the manifest
tracks an output with the same stem and that file still matches its
recorded hash. Matching by stem avoids loading the extension spec in
status paths. doctor keeps reporting leftover broken links for these
targets.
Refs #391
Copy and extension modes pruned every unexpected .md (or output-extension)
file in the agents target, so agent files a user kept there were deleted
on the next sync, unlike skills copy mode, which prunes only manifest
entries.
Copy and transform outputs are now tracked with the same checksum
manifest the merge fallback already uses, and prune removes only tracked
copies the user has not edited. Existing copies are adopted while their
agent is still synced, and an untracked pre-transform .md that still
matches its agent is treated as a stale copy, so switching to an
extension keeps cleaning it up. Copies already orphaned before upgrading
are kept and must be removed by hand.
copyTracker.pruneOrphans now continues past a failed removal and joins
the errors, so one locked file no longer leaves the other orphans behind.
prunableLink treated any stat failure as a broken link, so a live link
whose referent was temporarily unreadable (for example permission denied)
was deleted as if it pointed nowhere. Only a missing referent now counts
as broken.
PruneOrphanAgentLinks and PruneOrphanAgentCopies ignored os.Remove errors
and still listed the entry as removed, so sync reported a prune that did
not happen. Failed removals are now returned as errors, which the agent
runner already surfaces as warnings.
Merge-mode pruning for agents and extras removed any link whose name was
not expected, so links a user made to agent or extra files outside the
source were deleted on the next sync or `extras --remove-target --prune`.
Agents and extras do not record their links in a manifest, so the #315
provenance check cannot be reused. Prune now removes a link only when it
is broken or resolves inside the source. Relative links are resolved from
the real parent directory, matching how createLink writes them, so
orphans under a symlinked target directory are still found.
Mode changes, attach and the other AGENTS.md actions returned English
sentences, so a zh-TW dashboard showed "backed up ... before replacing
it" and "... is a directory" untranslated. Warnings are now
{code, params, message} and every instructions error carries a code,
so the dashboard shows them from i18n and falls back to the English
message for unknown codes. CLI output is unchanged.
Also from the Windows re-test:
- replacing a user's junction says so and where it pointed;
- status, doctor and sync agree on identical unowned copies (kept, not
linked), and an identical copy no longer suggests --force;
- the targets list shows a Developer Mode tooltip when file links are
unavailable;
- file names are taken from Windows paths too.
Refs #299
Exploratory CLI, dashboard and real-Windows testing of single-file extras
found paths that corrupted another shared file, lost user content, or
reported the wrong state.
- One shared file per link/copy target is now enforced in config
validation, so the CLI, sync and API all refuse it; an import is never
written through a link into another shared file (409
instructions_target_held in the API).
- Restore recreates an original Windows junction as a junction, which
needs no privilege, and remove restores before saving config so a
failed restore no longer orphans the record.
- Imports into dotfiles links, damaged managed blocks, repointed links
and CRLF files keep the user's content; project imports use paths
relative to the file so a moved repo keeps working.
- Mode and assign responses carry sync warnings; dry-run says when an
edit would be backed up; invalid modes no longer show as healthy.
- An edited copy reports modified, identical unowned copies count as
synced without being owned, and relative project links no longer show
drift.
- sync extras --json exits non-zero on errors; extras <name> --help
works; --add-target gains --as; detach messages match behavior.
Refs #299
Review of the file-link fallback found paths that lost or misreported
user data:
- An identical local file was adopted as a skillshare copy and later
pruned without backup. Only files sync writes are tracked now.
- Clearing all own text in import mode was treated as no record, so
switching back resurrected the attach-time content.
- The mode API saved the new mode and returned success when a directory
blocked the sync; it now keeps the old mode and returns 409.
- Restore preview promised a delete for files restore leaves alone; both
now share one ownership decision.
- Prune forgot ownership even when removing the copy failed.
Refs #299
createLink always tried `mklink /J` first. mklink does not check the
source type, so agents, single-file extras such as a shared AGENTS.md, and
per-file extras links became directory junctions that point at a file:
Explorer shows a folder and tools cannot read it. Sync then compared only
the link destination and kept the broken junction forever.
Files now get real symlinks only. When the OS cannot create them (Windows
without Developer Mode, non-elevated), file-based link modes fall back to
copies at the mode level, so status, doctor, the API and later syncs all
see an effective `copy` mode. Fallback copies are tracked by hash so they
keep updating and pruning without touching the user's own files, and turn
back into links once links work. Single-file extras remember what they last
wrote, so an unedited copy is replaced silently instead of producing a
drift backup on every source edit, and switching a target back to import
restores the user's attach-time content plus the import block.
Includes a Windows runbook and script, verified on a Windows 11 ARM64 VM
with and without symlink rights.
Refs #299
Tools disagree on agent frontmatter and some need another format entirely,
so an agent written for Claude is misread elsewhere. An `extension` on a
target's agents block reuses the extras transform mechanism to convert each
agent during sync.
Converted targets hold transformed output, so collect never pulls them back
into the source. Leftover symlinks from merge or symlink mode are removed
rather than written through, and a failed conversion drops the old output
so an unconverted agent never stays active.
The bundled opencode-agents extension keeps only fields OpenCode documents
and refuses agents that restrict their tools, since dropping those fields
would widen the agent's access.
Refs #267
Refs #241
Project-mode agent sync re-reported every agent as updated on the second
sync when the project lived under a symlinked ancestor (e.g. macOS temp
dirs under /var -> /private/var), failing idempotency on macOS CI.
Two interacting causes:
- shouldUseRelative was unstable: on the first sync the target directory
does not exist yet, so evalOrClean fell back to a non-resolved path and
the under-project-root check failed, producing an absolute link; on the
second sync the directory existed and resolved, so it wanted a relative
link and reformatted the existing one. evalOrClean now resolves the
deepest existing ancestor and re-appends the missing tail, so the answer
is the same whether or not the leaf exists.
- The existing-symlink comparison only did a direct string compare, so a
stable relative link whose resolved target carried the unresolved alias
prefix looked like it pointed elsewhere. It now canonicalizes both sides
via EvalSymlinks on the slow path, mirroring isSymlinkToSource.
Adds a regression test that reproduces the symlinked-ancestor case on any
platform.
Add SyncAgents() dispatcher supporting all three sync modes:
- merge: per-file symlinks with local file preservation
- symlink: whole directory symlink to agent source
- copy: file copy with content-diff detection
Add CheckAgentCollisions() to detect agents that flatten to the same
filename from different subdirectories.
Add PruneOrphanAgentLinks() for merge mode and PruneOrphanAgentCopies()
for copy mode to clean up stale agent files in targets.
Add CollectAgents() to copy non-symlinked .md files from target back
to agent source directory.
18 tests covering all modes, collision detection, pruning, and collect.