docs(deploy): WORKFORCE_WORKSPACE_ID/TOKEN are the cloud id and cloud access token

Merged
KH
2mo ago
+49-33

Problem

README.md and docs/SELF-DEPLOY.md told users to set:

  • WORKFORCE_WORKSPACE_ID = jq -r '.active' workspaces.json. That is a workspace name, not the UUID the doc itself asks for.
  • WORKFORCE_WORKSPACE_TOKEN = jq -r '.workspaces[.active].key' workspaces.json. That is a relaycast workspace key (rk_live_…).

Cloud request auth does not accept relaycast keys, so /api/v1/workspaces/<id>/deployments returns 401. With a relaycast rw_… id it returns 403.

Changes

  • SELF-DEPLOY §2: the token is the cloud access token (.accessToken in ~/.agentworkforce/relay/cloud-auth.json). The docs now say it expires (.accessTokenExpiresAt) and that re-running login refreshes it.
  • SELF-DEPLOY §2: the id is the cloud workspace id. CLIs with AgentWorkforce/workforce#342 print it after login. For older CLIs (this repo pins 4.1.56) there is a /resolve lookup that prints .cloudWorkspaceId. If that prints null, contact support; don't substitute another id.
  • An explicit warning about the two look-alikes (rk_ → 401, rw_ → 403).
  • The local-deploy snippet (§6), the README quick-start, the deploy-agent.yml header comment and the deploy-agents.mjs --help text all match.

No code or behaviour changes; docs and comments only.

Companion to AgentWorkforce/workforce#342, which fixes the CLI to use the cloud id and rejects rk_ tokens up front.

Known gap (not addressed here)

The only bearer that works for the CI override today is the login access token, and it expires. The SDK has issueWorkspaceToken for long-lived tokens, but cloud has no /tokens/workspace route and no CLI command exposes it. So CI secrets need refreshing by hand after each expiry.

🤖 Generated with Claude Code


[!NOTE]
Cursor Bugbot is generating a summary for commit cc6c3d99df2bd045267798516ed7081f4fc1ea38. Configure here.


Summary by cubic

Fixes the self-deploy instructions so CI deploys stop failing with 401/403: WORKFORCE_WORKSPACE_ID is the cloud workspace id and WORKFORCE_WORKSPACE_TOKEN is the cloud access token, not the relaycast key (rk_…) and id (rw_…) from workspaces.json.

  • Documents that the token expires and that re-running npx agentworkforce login refreshes it.
  • Adds a /resolve lookup for the cloud workspace id on CLIs that don't print it after login.
  • Notes that deploy-agents.mjs always requires both variables, even after login.
  • Updates the README quick-start, the deploy-agent.yml header comment, and the deploy-agents.mjs --help text to match.