diff --git a/.agent/context/20260913T-payment-prepare-regression.md b/.agent/context/20260913T-payment-prepare-regression.md new file mode 100644 index 0000000..fb271bc --- /dev/null +++ b/.agent/context/20260913T-payment-prepare-regression.md @@ -0,0 +1,30 @@ +# Payment prepare regression + +## Goal + +Restore the authenticated web console path that prepares a user-wallet payment +after quote approval, so approval reaches `POST /v1/jobs/user-wallet/prepare` +and can continue to wallet submission. + +## Acceptance criteria + +- Privy-authenticated console passes `usePrivyUserWallet()` into `App`. +- A connected-wallet approval uses the existing prepare and submit client + methods; it does not fall back to `POST /v1/jobs`. +- Existing server-wallet/API composition remains available when no browser + wallet is supplied. +- No settlement or idempotency boundary is changed. + +## Evidence and assumption + +- Commit `91a7744` removed the `usePrivyUserWallet()` call from + `apps/web/src/main.tsx`. +- `JobWorkspace` intentionally calls `start()` only when `userWallet` is + absent; otherwise it calls `prepareUserWalletJob()`. +- The fix is limited to the current repository and branch + `fix/restore-user-wallet-prepare`. + +## Non-goals + +- No API, storage, settlement, or worker changes. +- No changes to payment amounts, recipients, or provider idempotency logic. diff --git a/apps/web/src/main.tsx b/apps/web/src/main.tsx index 045c3e3..68b5a2a 100644 --- a/apps/web/src/main.tsx +++ b/apps/web/src/main.tsx @@ -13,10 +13,14 @@ const PrivyConsole = lazy(async () => { const module = await import('./auth/privy-session.js'); function AuthenticatedApp() { const session = module.usePrivyOperatorSession(); - // Privy login authenticates the operator only. Payments run server-side - // through the execution wallet (SERVER_PRIVY); the browser wallet is - // intentionally not wired into the console. - return session} />; + const userWallet = module.usePrivyUserWallet(); + return ( + session} + userWallet={userWallet} + /> + ); } return { default: () => (