Repository navigation
Description
Tracking issue for making the Recoup Vercel Board start Claude when a trusted teammate hands it a task. Today nothing answers: on 2026-11-19 Sid's Codex posted a task in #general mentioning @sweetmantech/claude, and it stayed ready with 0 replies. recoupable/board is a read-and-post viewer only, with no access control.
Goal
A task on the team board labeled agent=claude, owned by a trusted account, starts Claude within seconds of being posted. Claude claims the task by ID, replies in the thread as claude via api, and completes or fails it. The wake-up route and watcher live in recoupable/api (app/api/board/[[...path]]/route.ts, lib/board/), not in the new client repo. recoupable/board keeps only the viewer, now behind Privy sign-in that matches Music Nerd's pattern and Recoup's existing GET /api/admins check.
PRs (updated 2026-11-20)
| PR | Item | State |
|---|---|---|
| api#1295 | /api/board wake-up route + production-only claude watcher (label agent=claude, trusted owners) starting Claude in a Vercel Sandbox |
open (draft) -- 39 unit tests pass; preview checked: /api/board answers as the board handler; wake-up and Claude run provable only in production |
| board#3 | Privy sign-in on /board; inspector proxied only for Recoup admins |
open (draft) -- 30 unit tests and build pass; preview checked: /board redirects to sign-in; admin/non-admin untested until NEXT_PUBLIC_PRIVY_APP_ID is set |
| docs#TBD | Refresh operation-inventory.json to classify /api/board/{path} as an internal callback route |
not started (after api merges) |
Merge order: api → board → docs inventory refresh. The wake-up route is an internal callback like
/api/coding-agent/callback, so it gets no public reference page; the docs change is the inventory refresh, which needs the merged api commit to pin. Board auth can merge independently, but should land before anyone advertises theagent=claudelabel.
Open: next up (in merge order)
- api: wake-up route and
claudewatcher.- Why: a mention doesn't wake anything. Vercel's board watchers can't match
--mentionsyet ("Vercel's boards can't match mentions yet"), and a task owned by another principal must be claimed by ID. - Fix:
board({ watch })registered only whenVERCEL_ENV === "production"(previews register watchers too, which would start duplicate runs). Tail--label agent=claude;runacts ontask.created,task.ready,task.reopened, andlabels.changedsettingagent=claude, only for a root task that isready, unclaimed, and owned by a principal inBOARD_TRUSTED_PRINCIPALS. It starts a Vercel Sandbox withteam.as({ name: "claude" }).sandboxPolicy()(board credential injected by the sandbox proxy, never inside), npm, and AI Gateway with the gateway credential injected the same way. Claude Code in the sandbox claims the task by ID, replies, then completes or fails it. - Done when: unit tests cover the event filter and the trust check; a production-only watcher registers; on the preview,
POST /api/board/wakeanswers without registering preview watchers; after merge, a labeled task from a trusted owner gets a Claude reply and settles.
- Why: a mention doesn't wake anything. Vercel's board watchers can't match
- board: Privy sign-in.
- Why: the viewer reads and posts as the project for anyone with the URL, and labeled tasks will start agents.
- Fix: Privy email login like MusicNerdWeb's
PrivyProviderWrapper, sending the access token as a cookie (the inspector page's own fetches can't add anAuthorizationheader). The/boardroute checks it against Recoup'sGET /api/admins(Privy Bearer viavalidateAuthContext): no or bad token is 401 (page requests redirect to sign-in), non-admin is 403. No new api endpoint. - Done when: on the preview, signed-out
/boardredirects to sign-in, a non-admin gets 403, an admin sees the board.
Architecture decisions
- Route by label, not mention. Vercel's board refuses mention filters on watchers;
agent=claudeis set withvb tasks create general "..." --label agent=claude. - Trust is the task owner's principal. A task's text is instructions for whoever claims it, so only owners listed in
BOARD_TRUSTED_PRINCIPALSstart Claude. An empty list starts nothing. - No credential enters the sandbox. Board access comes from
sandboxPolicy(); the AI Gateway key is added by a network-policy header transform, asbuildGitHubCredentialBrokeringPolicydoes for GitHub. - Board sandboxes use
@vercel/sandbox3.9.1 (aliasedvercel-sandbox-3). The api's pinned 2.0.0-beta.11 drops the board policy's per-routematchandresponse: 403rules, which would put the board credential on every path of its host. - Board auth reuses Recoup's admin check. Music Nerd verifies the Privy token server-side and checks
is_admin; Recoup already does both inGET /api/admins, so the board calls it instead of adding an endpoint.
Settings someone with access must set (names only)
- api (production):
BOARD_TRUSTED_PRINCIPALS, comma-separated principal IDs (fromvb actors).AI_GATEWAY_API_KEYor the project's OIDC token must reach AI Gateway (already used by release packs). - board:
NEXT_PUBLIC_PRIVY_APP_IDfor preview and production (Recoup's Privy app), optionalRECOUP_API_URL; addboard.recoupable.devand its preview domain to the Privy app's allowed origins.
Source references
@vercel/board0.52.0 docs:01-board/06-watchers.md,01-board/11-tasks.md,03-guides/06-sandboxed-agents.md,03-guides/02-inspector.md.- Music Nerd:
xdjs/MusicNerdWebsrc/app/_components/PrivyProviderWrapper.tsx;xdjs/MusicNerdAPIlib/auth/verifyPrivyAccessToken.ts,authenticateAdmin.ts. - Recoup: api
lib/admins/checkAdminHandler.ts,lib/sandbox/vercel/sandbox/buildGitHubCredentialBrokeringPolicy.ts; chatproviders/PrivyProvider.tsx.
Activity