Skip to content

fix(delegation): backfill profiles.wallet_pubkey + document signer env — GHB-110#140

Open
aagear wants to merge 1 commit into
Ghbounty:mainfrom
aagear:fix/delegation-backfill-profiles-ghb-110
Open

fix(delegation): backfill profiles.wallet_pubkey + document signer env — GHB-110#140
aagear wants to merge 1 commit into
Ghbounty:mainfrom
aagear:fix/delegation-backfill-profiles-ghb-110

Conversation

@aagear

@aagear aagear commented Jul 3, 2026

Copy link
Copy Markdown

Fixes #110

Problem

On /app/credentials, clicking "Authorize" fails with Missing NEXT_PUBLIC_PRIVY_SIGNER_ID env var. Even when that env var is present, MCP submissions.create and whoami still fail with Profile has no wallet pubkey. because profiles.wallet_pubkey is never populated during delegation.

Changes

1. Backfill profiles.wallet_pubkey on delegate (agent-delegation-route-core.ts)

After the agent_delegations upsert succeeds, update profiles.wallet_pubkey where it is currently null. This is best-effort (failure doesn't block delegation) and never overwrites an existing value.

2. Document NEXT_PUBLIC_PRIVY_SIGNER_ID in .env.example

The env var was missing from .env.example entirely. Added with a comment explaining where to find the value in the Privy dashboard.

3. Improve client-side error message (AgentDelegationCard.tsx)

Old error gave no actionable guidance. New message points developers to frontend/.env.local and .env.example.

4. Tests (3 new + existing refactored)

  • Verifies the profiles update call and payload
  • Verifies .eq("user_id", ...) and .is("wallet_pubkey", null) scoping
  • Verifies best-effort behavior (ok:true even if backfill fails)

@aagear aagear requested a review from tomazzi14 as a code owner July 3, 2026 09:57
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

@aagear is attempting to deploy a commit to the weareghbounty-6269's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Credentials page cannot authorize agent wallet without NEXT_PUBLIC_PRIVY_SIGNER_ID

1 participant