reviewOwnerID returns the agent's owner user id — the webhook routing key for an inbound review event. It equals the reviewer today (the endpoint is account-scoped + ownership-checked), so on any lookup failure we fall back to the reviewer id rather than fail the already-committed release.
(ctx context.Context, agentID, fallbackUserID string)
| 268 | // account-scoped + ownership-checked), so on any lookup failure we fall back to |
| 269 | // the reviewer id rather than fail the already-committed release. |
| 270 | func (a *API) reviewOwnerID(ctx context.Context, agentID, fallbackUserID string) string { |
| 271 | ag, err := a.store.GetAgentByID(ctx, agentID) |
| 272 | if err != nil || ag == nil { |
| 273 | log.Printf("[api] review owner lookup for agent %s: %v (routing on reviewer)", agentID, err) |
| 274 | return fallbackUserID |
| 275 | } |
| 276 | return ag.UserID |
| 277 | } |
| 278 | |
| 279 | // RejectInboundReviewCore drops a held INBOUND message (status pending_review → |
| 280 | // review_rejected; it stays hidden from the agent, raw payload retained for |
no test coverage detected