Skip to content

Keyless fleet commands silently use the machine-global active workspace; a stale one yields a misleading 401 Invalid API key #1950

Open

Description

@khaliqgant

Symptom

Keyless agent-relay fleet ... commands (fleet nodes, fleet status) resolve the workspace key from the machine-global active workspace in ~/.agentworkforce/relay/workspaces.json when no --workspace-key / RELAY_WORKSPACE_KEY / RELAY_API_KEY is set. If that active entry is stale or rotated, the command returns 401 Invalid API key, which reads as a fleet or credential bug even though the intended workspace key is valid. workspace create and workspace switch mutate the same machine-global pointer, so one script or session silently changes what every other relay session on the box resolves to.

Impact

Hours lost diagnosing a "rotated key" or "auth split" that does not exist; scripts that create a throwaway workspace flip the active workspace for all other sessions on the host.

Evidence

Workaround used (not a fix)

Always pass --workspace-key or set RELAY_WORKSPACE_KEY; snapshot workspace list and workspace switch back after creating a workspace.

Expected

  • When a command falls back to the global active workspace, say so, and on 401 name the workspace it used ("key for active workspace default was rejected; pass --workspace-key or workspace switch").
  • Prefer the repository/project workspace over global state for fleet commands, as node up: prefer the repository workspace over stale global active state #1406 did for node up.
  • Offer a non-global way to create a workspace (e.g. workspace create --no-switch).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions