release: forward Privy JWT as RECOUP_ACCESS_TOKEN (#601) — final cutover bundle
Merged
SW
5mo ago+124+124+012345678901234567890123456789-15-15-01234567890123456789
Summary
Final open-agents → api cutover bundle. The chat UI's recoupAccessToken body field (a short-lived Privy JWT) now flows end-to-end:
validateChatWorkflowacceptsrecoupAccessToken: z.string().min(1).max(8192).optional()AgentContextgainsrecoupAccessToken?: stringhandleChatWorkflowStreamconditionally forwards intoagentContextbuildRecoupExecEnvinjectsRECOUP_ACCESS_TOKENinto the sandbox exec env
With this released, sandbox.recoupable.com can switch from sandbox.recoupable.com/api/chat → recoup-api.vercel.app/api/chat/workflow without UI changes. The recoup-api skill's curl examples will authenticate as the user; GET /api/accounts/id returns 200 with the user's account_id.
Cutover roadmap — all 5 bundles landed
| # | Bundle | Status |
|---|---|---|
| 1 | C per-message cost/usage | ✅ |
| 2 | B subagent live progress + transcript | ✅ |
| 3 | A.7 real cwd in system prompt | ✅ |
| 4 | A.6 Anthropic prompt cache control | ✅ |
| 5 | A.4 forward Privy JWT as recoupAccessToken | ✅ this release |
Test plan
- 5 new unit tests across validator + handler + env builder; full suite 3144/3144 pass
- E2E on preview verified: body
recoupAccessToken→RECOUP_ACCESS_TOKENbyte-for-byte in sandbox env; absent in body → unset in env (security path) - Cross-validated against open-agents production — same end-to-end behavior
🤖 Generated with Claude Code
Summary by cubic
Forwards the chat UI’s short‑lived Privy JWT (recoupAccessToken) end to end and exposes it in the sandbox as RECOUP_ACCESS_TOKEN, enabling the recoup-api skill to authenticate as the user. Completes the open‑agents → api cutover for auth-sensitive skills.
-
New Features
- Validator accepts optional
recoupAccessTokenin/api/chat/workflowbody. AgentContextaddsrecoupAccessToken?.handleChatWorkflowStreamforwards the token intoagentContextwhen present.buildRecoupExecEnvinjectsRECOUP_ACCESS_TOKEN(omitted when absent/empty).- Safety: long‑lived
recoup_sk_…API keys are not forwarded.
- Validator accepts optional
-
Migration
- No UI changes.
sandbox.recoupable.comcan switch torecoup-api.vercel.app/api/chat/workflow.
- No UI changes.