Follow-up to #323 (which fixed the immediate bug: read canonical ~/.agentworkforce/relay/cloud-auth.json + persist rotated tokens atomically).
Why
#323 is the pragmatic fix, but it still reimplements credential handling inside @pear/factory-sdk — a hardcoded path list, a bespoke onTokens persistence write, and its own atomic-write logic in relayfile-cloud-mount-client.ts. That's a second copy of credential lifecycle logic that can drift from agent-relay / the rest of the cloud#2108 unification.
The architecturally-correct endpoint of relay#1118 / cloud#2108 ("one canonical session, one credential store") is for every consumer to share one resolver + one refresher + one store, so a refresh by any CLI keeps all of them alive and there's a single source of truth for the path and the rotation logic.
What
Acceptance
- factory-sdk no longer hardcodes a creds path or its own persistence; it resolves + refreshes through the shared module.
- Cross-process refresh (daemon + reaper) does not invalidate either party's session.
Refs: #323, relay#1118, cloud#2108.
Follow-up to #323 (which fixed the immediate bug: read canonical
~/.agentworkforce/relay/cloud-auth.json+ persist rotated tokens atomically).Why
#323 is the pragmatic fix, but it still reimplements credential handling inside
@pear/factory-sdk— a hardcoded path list, a bespokeonTokenspersistence write, and its own atomic-write logic inrelayfile-cloud-mount-client.ts. That's a second copy of credential lifecycle logic that can drift fromagent-relay/ the rest of the cloud#2108 unification.The architecturally-correct endpoint of relay#1118 / cloud#2108 ("one canonical session, one credential store") is for every consumer to share one resolver + one refresher + one store, so a refresh by any CLI keeps all of them alive and there's a single source of truth for the path and the rotation logic.
What
resolveCloudCredentials/persistCloudCredentials(added in Fix factory cloud creds: read canonical store + persist token rotation #323) with a call into the shared cloud#2108 session/credential module used byagent-relay.Acceptance
Refs: #323, relay#1118, cloud#2108.