dashboard org-key mint broken by the #2579 approval gate — human session must not need agent-grade approval; UI shows raw 400/202; provisioner must project MOLECULE_PLATFORM_WORKSPACE_ID #2593

Open
opened 2026-06-11 16:41:25 +00:00 by core-devops · 0 comments
Member

Live report (agents-team, 2026-06-11 09:37 local): minting an Organization API Key from Settings → Org API Keys fails with the raw error:

API POST /org/tokens: 400 {"error":"no approval anchor for this caller class — set MOLECULE_PLATFORM_WORKSPACE_ID for admin-token callers, or call via a session / org-token with a valid org"}

This is fallout from #2574→#2579 (org_token_mint approval gate — correct fix, incomplete rollout):

  1. The dashboard's mint reaches the tenant as the admin-token caller class (the app/edge calls server-side with ADMIN_TOKEN; orgTokenActor only detects session via Cookie header, which doesn't survive the proxy hop). So a HUMAN clicking + New Key gets the agent-grade gate.
  2. No tenant has MOLECULE_PLATFORM_WORKSPACE_ID set — the provisioner never projects it — so the anchor derivation fails → hard 400. I hand-fixed agents-team (env-carry recreate of molecule-tenant with MOLECULE_PLATFORM_WORKSPACE_ID=); verified the gate then behaves as designed: POST → 202 {approval_id, pending_approval}; deny works. This hand-fix dies on next redeploy and covers ONE tenant.
  3. The UI doesn't speak the gate protocol: raw 400 (and presumably 202) rendered as an error string.

Asks:

  • (design) Human-initiated mints (dashboard) should NOT require an approval round-trip — the human IS the approver. Either propagate the user identity/session through the edge so the handler can distinguish human vs agent admin-token calls, or have the dashboard pre-create+auto-approve in one step. Keep the full gate for agent callers (the #2574 incident class).
  • (provisioner, CP) Project MOLECULE_PLATFORM_WORKSPACE_ID=<uuidv5(org,"molecule-platform-agent")> into tenant user-data + redeploy path so every tenant has a valid anchor.
  • (UI) Handle 202 pending_approval (link to the approvals pane) instead of rendering raw JSON as error.
  • Tests: dashboard-mint e2e (human path), agent-mint integration (202 + decide + consume).

🤖 Generated with Claude Code

Live report (agents-team, 2026-06-11 09:37 local): minting an Organization API Key from Settings → Org API Keys fails with the raw error: ``` API POST /org/tokens: 400 {"error":"no approval anchor for this caller class — set MOLECULE_PLATFORM_WORKSPACE_ID for admin-token callers, or call via a session / org-token with a valid org"} ``` This is fallout from #2574→#2579 (org_token_mint approval gate — correct fix, incomplete rollout): 1. **The dashboard's mint reaches the tenant as the admin-token caller class** (the app/edge calls server-side with ADMIN_TOKEN; `orgTokenActor` only detects session via Cookie header, which doesn't survive the proxy hop). So a HUMAN clicking + New Key gets the agent-grade gate. 2. **No tenant has MOLECULE_PLATFORM_WORKSPACE_ID set** — the provisioner never projects it — so the anchor derivation fails → hard 400. I hand-fixed agents-team (env-carry recreate of molecule-tenant with MOLECULE_PLATFORM_WORKSPACE_ID=<concierge uuidv5>); verified the gate then behaves as designed: POST → 202 {approval_id, pending_approval}; deny works. **This hand-fix dies on next redeploy and covers ONE tenant.** 3. **The UI doesn't speak the gate protocol**: raw 400 (and presumably 202) rendered as an error string. Asks: - **(design)** Human-initiated mints (dashboard) should NOT require an approval round-trip — the human IS the approver. Either propagate the user identity/session through the edge so the handler can distinguish human vs agent admin-token calls, or have the dashboard pre-create+auto-approve in one step. Keep the full gate for agent callers (the #2574 incident class). - **(provisioner, CP)** Project `MOLECULE_PLATFORM_WORKSPACE_ID=<uuidv5(org,"molecule-platform-agent")>` into tenant user-data + redeploy path so every tenant has a valid anchor. - **(UI)** Handle 202 pending_approval (link to the approvals pane) instead of rendering raw JSON as error. - Tests: dashboard-mint e2e (human path), agent-mint integration (202 + decide + consume). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2593