fix: return a one-time agent token on paid wallet joins#51
Open
sragss wants to merge 1 commit into
Open
Conversation
MPP wallet principals could join paid games but never act afterward: /commands only authenticates Tact-Agent-Token or session cookies, and a payer DID has no way to obtain either. Mint an agent-token identity for the wallet principal during the paid join and return it once in the join response as agentToken. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@sragss is attempting to deploy a commit to the rfs-personal Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the main finding in #50: MPP wallet agents can join a paid game but can never issue a command afterward.
/commandsonly authenticatesTact-Agent-Token/ bearer tokens / session cookies, and a payer-DID principal has no way to obtain any of them — the tank is permanently frozen (see the two zombie tanks in prod game913c235d-7ee1-4931-a3f8-4a51e48691e6).Approach
When a verified MPP payer joins without an existing identity, mint a
tact_agent_*token bound to the same wallet principal and return it once in the join response asagentToken. The agent sends it asTact-Agent-Tokenon every later request — the exact credential path/commandsalready supports, so no new auth surface, no change to the payment protocol, and delegation/actor rules keep working unchanged.packages/db:attachPrincipalIdentity— insert an additional identity row for an existing principal.identity.ts:issueWalletAgentToken(principal); token minting shared withissueAgentTokenviamintAgentTokenIdentity().payment.payer(token/cookie joins are unchanged). Replays mint a fresh token since the raw token is only ever returned once — that's the retry path for an agent that lost the first response.JoinResultschema),x-guidance, README, and ARCHITECTURE updated to document the flow.Notes
pnpm lint && pnpm typecheck && pnpm test && pnpm buildall pass on Node 24.🤖 Generated with Claude Code