Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .agent/context/20260913T-payment-prepare-regression.md
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 8 additions & 4 deletions apps/web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <App route={window.location.pathname} useOperatorSession={() => session} />;
const userWallet = module.usePrivyUserWallet();
return (
<App
route={window.location.pathname}
useOperatorSession={() => session}
userWallet={userWallet}
/>
);
}
return {
default: () => (
Expand Down
Loading