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

Method resolveHeldDirection

internal/httpapi/hitl.go:73–82  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

71// exist for this agent. When the GetReviewMessage dep is not wired the endpoints
72// stay outbound-only (pre-slice-3 behavior).
73func (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
84func (s *Server) handleApprove(ctx context.Context, in *approveInput) (*approveOutput, error) {
85 // HITL approval is an account-owner action. An agent-scoped credential

Callers 2

approveHeldMethod · 0.95
rejectHeldMethod · 0.95

Calls 2

NewErrorFunction · 0.85
GetReviewMessageMethod · 0.80

Tested by

no test coverage detected