Skip to content

Handle missing relayfile delegated credentials during mount preflight #28

Description

@miyaontherelay

Problem

factory start --mode live --config ./factory.config.json can fail before startup when the local relayfile workspace catalog exists but the delegated relayfile credential cache is missing.

Observed failure:

[factory] relayfile mount start failed (exit 1): error: resolve delegated relayfile credentials: delegated relayfile credentials are required: /Users/khaliqgant/.relayfile/delegated/f96b6a002731a95006862230/12e1c5683dd6145dbf5e21cd.json not found

Local state at the time:

  • ~/.relayfile/workspaces.json had workspace default / rw_7ccfea89
  • ~/.relayfile/credentials.json existed
  • ~/.relayfile/delegated/.../*.json did not exist
  • Running relayfile workspace join rw_7ccfea89 --write recreated the missing delegated credential file and allowed relayfile start rw_7ccfea89 .integrations --background to proceed

Why this belongs in factory

Factory currently starts the local relayfile mount via the relayfile CLI during mount preflight. When the CLI reports missing delegated credentials, factory surfaces the raw CLI error. It does not classify this as an auth/bootstrap error and does not provide the actionable recovery command.

Desired behavior

Factory should make this failure operator-friendly and robust:

  • Detect relayfile CLI errors containing delegated relayfile credentials are required / missing delegated credential file.
  • Report a clear recovery hint, probably:
relayfile workspace join <workspaceId> --write
  • Consider whether factory can safely run that bootstrap step itself when cloud credentials are present, or at least expose a bounded repair command.
  • Add regression coverage around ensureLocalMount / spawnMountViaCli for this error shape.

Notes

This is separate from relayfile CLI ownership. Relayfile should probably be able to re-mint the missing delegated cache from valid cloud credentials, but factory still needs good diagnostics because it owns the startup UX.

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