Fix #380: derive clientsPicked from pre-filter selection so fleet-managed machines install skills/agents#382
Fix #380: derive clientsPicked from pre-filter selection so fleet-managed machines install skills/agents#382philcunliffe wants to merge 2 commits into
Conversation
On a fleet-managed machine the org can lock both clients (claude/codex). The wizard pick phase correctly drops locked ids from the local-layer config composition (they already live in the central layer), but it also derived `clientsPicked` from that already-filtered `sources` list. On a fully managed machine that made `clientsPicked` empty, and the finale gates attach + skills-install + agents-install on `clientsPicked.length`, so all three silently no-op'd. Those three finale steps are per-machine LOCAL work (client settings, skills, agents) that is NOT in the central layer, so it must still run for org-locked clients (LLP 0135 #finale: skills/agents install iterates clientsPicked). Derive `clientsPicked` from the pre-filter selection (rawSources plus lockedSources), keeping the locked filter only for the config-layer composition. Adds a regression test for a fully fleet-managed machine (both clients locked) asserting clientsPicked names both while nothing is re-composed into the local layer, and updates the single-locked-client test that had codified the buggy clientsPicked derivation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
neutral-reconcile REVIEW — PR #382 (head fbb9cc4)Verdict: CLEAN. No actionable findings. Nothing pushed; PR left held for the reconcilePR spine. What the change does
Correctness (verified)
Edge cases checked
Gates
Head reviewed: fbb9cc4. No fixes pushed; head unchanged. |
# Conflicts: # test/core/cli/wizard/pick.test.js
Re-review after head moved (merge resolution of #381 conflict) — CLEANVerdict: CLEAN, nothing actionable. Head reviewed: Merge resolution is correct
#382 fix intact and correct against the post-#381 structure
Regression test genuinely gates the fix
Style / refs
Test results
Non-blocking observation (not this PR's scope)The legacy |
Root cause
src/core/cli/wizard/pick.jscorrectly filters org-locked sources out of the local-layer config composition (const sources = rawSources.filter((id) => !lockedSet.has(id))) because locked clients already live in the central layer. ButclientsPickedwas then derived from that already-filteredsourceslist. On a fleet-managed machine where the org locks bothclaudeandcodex,sourcesis empty, soclientsPickedwas[].The finale (
runPickerFinaleinwalkthrough.js) gates client attach, skills install, and agents install onclientsPicked.length > 0. Those three steps are per-machine LOCAL work (client settings,~/.claudeskills/agents) that is NOT in the central layer, so they must still run for org-locked clients. WithclientsPickedempty, all three silently no-op'd on every fleet-managed machine.LLP 0135 #finale is explicit that skills/agents install iterates
clientsPickedand is untouched by the managed/join pathway; only daemon-install/attach are skipped when the join lane already did them. So the locked filter belongs to config composition, not toclientsPicked.Fix
Derive
clientsPickedfrom the pre-filter selection (rawSources∪lockedSources), keepingconst sources = rawSources.filter(...)untouched for config-layer composition. Using the union (rather than justrawSources) is robust even if a prompt does not echo back a disabled+checked locked row.Regression test
test/core/cli/wizard/pick.test.js:runWizardPick: a fully fleet-managed machine still reports its locked clients as picked so the finale installs skills/agents- both clients locked; assertssourcesPicked === []and no adapter re-composed into the local config, butclientsPicked === ['claude', 'codex']. Fails before the fix (clientsPickedwas[]), passes after.clientsPickedassertion, which had codified the buggy derivation (['codex']->['claude', 'codex']).Full
npm testsuite: only 7 pre-existing failures intest/core/leave-command.test.jsremain (confirmed failing on untouchedorigin/master, unrelated to this change); all wizard/pick tests pass.Fixes #380