SetMessageScreening denormalizes a screening verdict onto an already-created message row (review_reason / scan_score / scan_action). The inbound path sets these at INSERT time; the outbound path creates the row first (send or HITL hold) and annotates after, so it needs this UPDATE. Agent-scoped to k
(ctx context.Context, messageID, agentID, reviewReason string, scanScore *float64, scanAction string)
| 189 | // hold) and annotates after, so it needs this UPDATE. Agent-scoped to keep the |
| 190 | // write within the owning tenant. scanScore may be nil (gate-only verdicts). |
| 191 | func (s *Store) SetMessageScreening(ctx context.Context, messageID, agentID, reviewReason string, scanScore *float64, scanAction string) error { |
| 192 | _, err := s.pool.Exec(ctx, |
| 193 | `UPDATE messages |
| 194 | SET review_reason = $3, scan_score = $4, scan_action = $5 |
| 195 | WHERE id = $1 AND agent_id = $2`, |
| 196 | messageID, agentID, nullIfEmptyString(reviewReason), scanScore, nullIfEmptyString(scanAction)) |
| 197 | return err |
| 198 | } |
no test coverage detected