Skip to content

fix(sync): let --force take over an agent file that already matches - #944

Merged
runkids merged 1 commit into
mainfrom
runkids/kept-agents-followups
Nov 17, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/kept-agents-followups

Conversation

@runkids

@runkids runkids commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

Follow-up to #942 and #943. No issue.

Summary

Three leftovers from the review of #942 and #943.

  • sync agents --force could not take over an identical agent file. Without file-link privilege (Windows without Developer Mode), merge mode copies agents and tracks the copies it wrote. A file the tool already had with the same bytes as the source was kept, and --force kept it too, because the identical-content check ran first. init then printed kept local agents: X (sync agents --force replaces them) for a file --force never replaced. With --force the file is now recorded as skillshare's, so later syncs update it. Without --force nothing changes.
  • One helper for the name cap. sync.ListNames replaces the five-name cap that fix(init): name the agent files the first sync kept #943 wrote a second time in cmd/. Output is unchanged.
  • doctor.md and its four translations say when a broken link under a recorded name is reported as a broken symlink (the behavior from fix(diff): list only what sync prunes, and have doctor follow it #942).

Checks

  • make check in a devcontainer: exit 0.
  • TestSyncAgents_MergeWithoutFileLinksForceTakesOverIdenticalFile fails on main (the file stays v1 and is reported as skipped) and passes here.
  • Website build (npm ci && npm run build) in the devcontainer: all five locales built.

Not run: UI tests, and the Windows UTM runbook. The fix is for the no-file-link fallback, which the unit test simulates with SetFileLinksForTest(false); it has not been run on a real Windows guest.

Not covered:

  • A file taken over with --force is pruned like any tracked copy once its agent leaves the source. That is what --force already means for a file it overwrites.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR — one fix plus two small leftovers from the same review

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).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T05:55:05.121336Z e0ad37f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit c626c4b into main Nov 17, 2026
9 checks passed
@runkids
runkids deleted the runkids/kept-agents-followups branch November 17, 2026 06:01
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