Commit Graph
1 Commits
Author SHA1 Message Date
ggbdpq 38c3ba846f library: an edit made in the shared copy of a skill is taken into the library (#4958)
What changed: takeEdits reads the shared copy too - ~/.agents/skills
where no link could be made (Windows without the right to), the entry a
marked copy - as it reads an agent's copy: anything newer than the
copy's mark is an edit, the newest one taken unless the library changed
after it, losers kept aside. An agent whose own folder ~/.agents/skills
is has its copy read as it was; the shared scan only runs where no
target already covered that folder. syncShared, which sets a stale copy
aside before copying again, runs after, so the edit is in the library
and every other agent's copy first.

Run:
- go test ./internal/library -run TestEditInSharedCopyTaken -count=1
  RED before: the edit wasn't taken (the library's skill has no
  notes.md) and the shared entry lost it; green after.
- go test ./internal/library -count=1: ok (66s).
- gofmt, go vet -tags nogui (darwin/linux/windows), builds
  (darwin/linux/windows), the new test with -race: clean.

Generated-by: GLM-5.3-Flash (ZCode)

Reviewed and ported: differs from 1851ead1a, which handled an agent's
own copy; the shared ~/.agents/skills copy (Windows' marked copy where no
link can be made) was still overwritten by syncShared. On mote, with
skill_edits.go at the parent: TestEditInSharedCopyTaken FAIL ("the edit
in the shared copy wasn't taken into the library", "the shared entry
lost the edit"); green with the patch. go test ./internal/library ok on
mote, and TestEditInSharedCopyTaken ok on Windows (win-run, xiaomi-gpu).
GOOS=linux/windows/darwin go vet -tags nogui ok. Not tried: the real
GUI's "Put skills in ~/.agents/skills" on Windows with a real agent.

Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-11-05 18:31:17 +08:00