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)
| 924 | // leave a phantom inbox the user never authorized. |
| 925 | // webhookURL and agentMode are accepted but IGNORED — see CreateAgent. |
| 926 | func (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 |
no test coverage detected