resolveHeldDirection looks up a held message scoped to the resolved owned agent and reports whether it is inbound. It returns (meta, true, nil) for an inbound hold (route to the release path), (nil, false, nil) for an outbound hold (fall through to the send-approval path), or a 404 envelope when the
(ctx context.Context, messageID, agentID string)
| 71 | // exist for this agent. When the GetReviewMessage dep is not wired the endpoints |
| 72 | // stay outbound-only (pre-slice-3 behavior). |
| 73 | func (s *Server) resolveHeldDirection(ctx context.Context, messageID, agentID string) (*identity.ReviewMessageMeta, bool, error) { |
| 74 | if s.deps.GetReviewMessage == nil { |
| 75 | return nil, false, nil |
| 76 | } |
| 77 | meta, err := s.deps.GetReviewMessage(ctx, messageID, agentID) |
| 78 | if err != nil || meta == nil { |
| 79 | return nil, false, NewError(http.StatusNotFound, "not_found", "message not found") |
| 80 | } |
| 81 | return meta, meta.Direction == "inbound", nil |
| 82 | } |
| 83 | |
| 84 | func (s *Server) handleApprove(ctx context.Context, in *approveInput) (*approveOutput, error) { |
| 85 | // HITL approval is an account-owner action. An agent-scoped credential |
no test coverage detected