Commit Graph
3 Commits
Author SHA1 Message Date
Willie 8e9ef1c806 test(sync): make the tests pass on Windows and run them in CI
Ten tests assumed POSIX behaviour:

- Five asserted os.ModeSymlink, but Windows links with a junction;
  check utils.IsLinkMode instead.
- Two used `/abs/...` as an absolute path, which has no volume on
  Windows; give the fixtures one.
- Windows has no permission bits to preserve, so the 0600 check is
  skipped there.
- Reading a file as a directory reports not-exist on Windows, which
  prune ignores, so that prune-error test is skipped there.
- A single-file extension relies on the shebang and the executable bit,
  so ListExtensions finds only directory extensions on Windows, as the
  extras docs describe.

Add ./internal/sync and ./internal/trash to the windows-test package
list so they stay green.

Refs #344
2026-10-06 09:40:50 +08:00
Willie f313e3c37f fix(sync): report agent prune failures instead of dropping them
Both the CLI and the Web API discarded the error from pruning orphaned
agents, so a target whose directory could not be read looked clean while
stale links stayed behind. The shared runner now turns the error into a
"<target>: agents prune failed: <err>" warning, which both callers
already render. The sync itself still counts, matching how skills treat
prune failures.
2026-09-30 01:57:31 +08:00
Willie 47a6a17a69 refactor(sync): share the agents sync loop between CLI and server
The CLI and the Web API each carried their own filter, sync or transform,
then prune loop for agents, and the copies had started to drift. Both now
call sync.RunAgentSync and render its per-target results as before.

This is a pure refactor: characterization tests pin the server's 200 with
warnings on a per-target failure, the CLI's non-zero exit, the server's
silent skip of targets without an agents path, and the merge of agent
lists into the skills row. Prune errors are now returned in the result
but still ignored by both callers; surfacing them is a separate fix.
2026-09-30 01:56:07 +08:00