Skip to content

factory-sdk: delegate cloud creds to the shared cloud#2108 session module (retire factory-local read+persist) #324

@khaliqgant

Description

@khaliqgant

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions