MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / CreateAgentTx

Method CreateAgentTx

internal/identity/store.go:926–928  ·  view source on GitHub ↗

CreateAgentTx inserts an agent inside a caller-owned transaction. Used by the OAuth consent flow so the slug auto-create row and the authorization-code insert (in oauth_auth_codes) commit together — without this, a code-issue failure after the agent commit would leave a phantom inbox the user never

(ctx context.Context, tx pgx.Tx, agentEmail, domain, name, webhookURL, agentMode, userID string)

Source from the content-addressed store, hash-verified

924// leave a phantom inbox the user never authorized.
925// webhookURL and agentMode are accepted but IGNORED — see CreateAgent.
926func (s *Store) CreateAgentTx(ctx context.Context, tx pgx.Tx, agentEmail, domain, name, webhookURL, agentMode, userID string) (*AgentIdentity, error) {
927 return createAgent(ctx, tx, agentEmail, domain, name, userID)
928}
929
930// agentExecutor is the subset of pgxpool.Pool + pgx.Tx that
931// createAgent needs. Lets the same body serve both stand-alone and

Callers 1

Implementers 1

Storeinternal/identity/store.go

Calls 1

createAgentFunction · 0.70

Tested by

no test coverage detected