From 9aee6e769a19fcf21493f9f76c967bc3ff5557de Mon Sep 17 00:00:00 2001 From: Claudomator Agent Date: Wed, 8 Jul 2026 09:31:15 +0000 Subject: feat(agentloop,executor): expose report_verdict as a tool on both transports --- internal/executor/agentmcp.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'internal/executor/agentmcp.go') diff --git a/internal/executor/agentmcp.go b/internal/executor/agentmcp.go index 0b36c14..35781e2 100644 --- a/internal/executor/agentmcp.go +++ b/internal/executor/agentmcp.go @@ -106,6 +106,11 @@ func (in proposeRoleConfigInput) toRoleConfig() role.RoleConfig { } } +type reportVerdictInput struct { + Approved bool `json:"approved" jsonschema:"true if the work meets its acceptance criteria and should proceed; false if it needs to be sent back for a fix"` + Reasoning string `json:"reasoning" jsonschema:"a concise explanation of the decision"` +} + func textResult(text string) *mcp.CallToolResult { return &mcp.CallToolResult{Content: []mcp.Content{&mcp.TextContent{Text: text}}} } @@ -197,6 +202,16 @@ func newAgentServer(ch AgentChannel) *mcp.Server { return textResult(fmt.Sprintf("Proposed role config %s v%d (draft)", in.Role, version)), nil, nil }) + mcp.AddTool(s, &mcp.Tool{ + Name: "report_verdict", + Description: "Report a structured approve/reject decision after evaluating another task's work (e.g. as an arbitration-role task). Call this before report_summary when your job is to decide whether the work is acceptable -- this is read by the orchestrator to decide the outcome, not just logged for a human to read later.", + }, func(ctx context.Context, _ *mcp.CallToolRequest, in reportVerdictInput) (*mcp.CallToolResult, any, error) { + if err := ch.ReportVerdict(ctx, in.Approved, in.Reasoning); err != nil { + return nil, nil, err + } + return textResult("Verdict recorded."), nil, nil + }) + return s } -- cgit v1.2.3