Skip to content

Turn automatic sync on once a sync target is configured - #61

Merged
rhiever merged 3 commits into
mainfrom
sync-target-add-enables-auto
Jul 20, 2026
Merged

Turn automatic sync on once a sync target is configured#61
rhiever merged 3 commits into
mainfrom
sync-target-add-enables-auto

Conversation

@rhiever

@rhiever rhiever commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Configuring a sync target is the statement of intent to keep it current, so automatic sync now resolves to on from that point instead of waiting for a separate sync auto on that most people never found. Getting to a synced state drops from three commands to two.

Respecting an explicit choice

A stated preference always wins. auto on and auto off record that the user chose, and adding more targets never overrides that choice, so turning it off once keeps it off.

This is structural rather than a guard: target add no longer writes to the auto config at all, so it cannot overwrite a preference.

One place answers the question

The policy lives in automatic_sync_enabled, read by the background gate, the sync auto display, and sync target add. Those three previously each read auto.enabled directly and would have drifted into reporting different answers for the same config.

Why two bools rather than a nullable tri-state

enabled: bool | None would express this in one field, but load_sync_config validates straight into the model, so a null there would raise on any older CLI that still types the field as bool, breaking every command after a downgrade. An unknown extra key is ignored instead, so an older CLI reads a config written by this one and falls back to enabled.

Pre-existing configs

A config written before the field existed carries no preference and follows the default. Automatic sync shipped opt-in, so enabled: false in such a config almost always means untouched rather than declined, and treating those as opted-out would strand the majority to protect a near-empty set.

Verification

pre-commit run --all-files and pytest both pass; 1053 tests. Also exercised the real binary end to end: fresh add turns it on, auto off, then two further target adds confirming it stays off and reports why, then auto on restores it.

Companion changes

User-facing wording moves from "automatic pull" to "automatic sync". The matching docs update is in goodeye-docs, and the section rename moves an anchor that a published changelog entry links to, fixed in the server repo.

🤖 Generated with Claude Code

rhiever and others added 3 commits July 20, 2026 12:45
Configuring a target is the statement of intent to keep it current, so
automatic sync now resolves to on from that point instead of waiting for
a separate `sync auto on` that most people never found.

A stated preference always wins. `auto on` and `auto off` record that the
user chose, and adding more targets never overrides that choice, so
turning it off once keeps it off.

The policy lives in one function, `automatic_sync_enabled`, read by the
background gate, the `sync auto` display, and `sync target add`. Those
three previously each read `auto.enabled` directly and would have drifted
into reporting different answers for the same config. Nothing is written
to reach the answer, so adding a target cannot overwrite a preference.

`explicitly_set` is a plain bool rather than a nullable `enabled`
tri-state because `load_sync_config` validates straight into the model:
a null there would raise on any older CLI that still types the field as
bool, breaking every command after a downgrade.

A config written before the field existed carries no preference and so
follows the default. Automatic sync shipped opt-in, so `enabled: false`
in such a config almost always means untouched rather than declined.

User-facing wording moves from "automatic pull" to "automatic sync".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The module docstring still described automatic pull as something the user
opts into with `skills sync auto on`, which contradicts the gate below it:
having a sync target is what turns automatic sync on, and an explicit
preference is what overrides that. Point the docstring at
automatic_sync_enabled as the single resolved answer.
The --json output of skills sync target add carried automatic_sync_enabled
only when it created a new target, not when it appended --only entries to an
existing one, so the same command returned two payload shapes. Add the field
to the append branch so machine readers see it on every target add.
@rhiever
rhiever merged commit 7dbcb1b into main Jul 20, 2026
1 check passed
@rhiever
rhiever deleted the sync-target-add-enables-auto branch July 20, 2026 21:17
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