fix: make hyp init migrate joined upgrades into proxy mode - #846
fix: make hyp init migrate joined upgrades into proxy mode#846philcunliffe wants to merge 1 commit into
Conversation
The joined finale read any `_hypaware` marker as "attach already done" and left its one daemon restart at the end of the lane. On an enrolled machine upgrading from a base-URL version, that meant: skip the install, skip the attach, restart last, mint the proxy CA after the only chance to attach had passed - and report success with Claude still on `base_url`. Two gaps, both between the code and LLP 0243/0244 rather than in what they settled: - The attach probe returned the marker's version and port but not its `mode`, so `base_url` and `proxy` were indistinguishable to every caller. It now reports the mode, and `hyp status` carries it on the client row. - The finale's CA wait was gated on having installed a daemon. When the install is skipped but a restart is still coming and the governing gateway runs in proxy mode, the restart now moves ahead of attach instead of a second one being added, so the CA exists when adapters preflight on it. The wizard's joined skip is now mode-aware: a client whose picker row attaches through the proxy and whose marker records anything else is not skipped. Fixes #842 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
neutral was resolving this branch's conflict against newly-merged The textual conflict (resolvable, not the blocker)
Item 1 of this PR's "What changed" list is already on The real conflict is semantic, and it is in the files that did not conflict
So both halves of this PR now point at a mode nothing attaches in: Half 1, the mode-aware skip.
Half 2, the restart-before-attach reordering. Its entire justification is getting the proxy CA minted before the attach loop, because "adapters pick their mode by whether the CA file exists". An What is not fixed by #818, and still needs this PR's ideaThe bug in #842 is real and open on The call a human needs to make
One adjacent thing you may want in the same call: Nothing has been pushed; the branch is untouched at Reply with a comment on this PR (or push to the branch); neutral monitors this thread and will re-engage with your guidance on its next tick. |
What was wrong
On a fleet-enrolled machine upgrading from a base-URL version to a proxy-capable
one, the attended
hyp initteam pathway reported success while leaving Claudeattached with
_hypaware.mode: "base_url". Two independent gaps stacked:The attach probe could not tell the two attaches apart.
probeClientAttachFromDescriptorreturned the marker'sversionandportbut not its
mode, sorunWizardFinale'sattached: truefilter read astale base-URL attach as work enrollment had already done and put the client
into
skipAttachClients.Proxy CA readiness came after the last chance to attach.
runPickerFinalegated its CA wait on!skipInstall. With the installskipped, the one restart that puts proxy mode (and therefore the CA) on the
wire sat at the very end of the lane, after the attach loop. Even an
unattached client would have entered that loop with no CA on disk and been
attached by base URL, exactly as the issue describes.
What changed
probeClientAttachFromDescriptorreports the marker'smode, andhyp statuscarries it on the client row (ClientAttachReport.mode). Thisis also the state LLP 0244's consequences list wanted status to be able to
name.
gateway_proxy_modeand whose marker records anything butproxy, on aninstall whose governing gateway runs proxy mode, is no longer skipped.
runPickerFinalemoves its single daemon restart ahead of attach (instead ofadding a second one) when the install was skipped, a restart is coming, and
governingGatewayProxyModesays the gateway will run in proxy mode. The tailrestart then stands down. Base-URL installs and
--no-daemonkeep today'sordering byte for byte.
governingGatewayProxyModeis the central-layer-aware predicate extracted outof
waitForProxyCaBeforeAttach, so the wizard and the finale answer "will thisgateway run proxy mode" the same way (LLP 0244 #central-managed).
restartDaemonFnjoinsinstallDaemonFnas an injectable seam, for the sameLLP 0181 reason: the real service-manager call refuses to spawn launchd or
systemd under the test runner, so the ordering would otherwise be untestable.
No new LLP
This closes a gap between the code and LLP 0243/0244 rather than changing what
they settled. LLP 0243 #composed-default already requires a proxy-mode install
to attach in proxy mode rather than lose the race to the CA mint; LLP 0244's
consent gate covers writing
proxy_modeinto a config that lacks it, which isnot what this path does (the key is already governing, from the central layer or
from the fold the user's own picks drove). The CA trust grant keeps its own
dialog (LLP 0237) untouched.
Regression test
test/core/cli/wizard/joined-upgrade-proxy-attach.test.jsOn
masterfour of its five cases fail; with this change all five pass, and therest of the suite is unchanged (the 22 remaining failures in this sandbox are
pre-existing parquet/cache/report-render failures from optional deps that are
not installed here, identical before and after).
a joined upgrade does not skip attach for a client still marked base_url-drives
runInitWizarddown the team pathway against a home whose~/.claude/settings.jsoncarries amode: "base_url"marker and asserts thefinale is not handed
claudeinskipAttachClients.a joined upgrade does not skip attach for a marker that records no mode at alla joined run still skips attach for a client already attached by proxy-pins that the skip still does its original job.
a skipped install restarts the daemon before attach so the proxy CA exists-asserts the event order is
restart, ca-wait, attach, exactly one restart.a skipped install with no proxy mode leaves the restart at the endnpm testandnpm run typecheckwere run locally; typecheck reports no errorsin any changed file.
Fixes #842