MCPcopy Create free account
hub / github.com/astercloud/aster / getApproval

Method getApproval

pkg/middleware/hitl.go:250–265  ·  view source on GitHub ↗

getApproval 获取人工审核决策

(ctx context.Context, request *ReviewRequest)

Source from the content-addressed store, hash-verified

248
249// getApproval 获取人工审核决策
250func (m *HumanInTheLoopMiddleware) getApproval(ctx context.Context, request *ReviewRequest) ([]Decision, error) {
251 if m.approvalHandler != nil {
252 return m.approvalHandler(ctx, request)
253 }
254
255 // 默认处理器: 自动批准所有请求
256 hitlLog.Warn(ctx, "no approval handler configured, auto-approving", map[string]any{"requests": len(request.ActionRequests)})
257 decisions := make([]Decision, len(request.ActionRequests))
258 for i := range decisions {
259 decisions[i] = Decision{
260 Type: DecisionApprove,
261 Reason: "Auto-approved (no approval handler configured)",
262 }
263 }
264 return decisions, nil
265}
266
267// SetApprovalHandler 设置审核处理器
268func (m *HumanInTheLoopMiddleware) SetApprovalHandler(handler ApprovalHandler) {

Callers 1

WrapToolCallMethod · 0.95

Calls 1

WarnMethod · 0.65

Tested by

no test coverage detected