Add tool approval middleware for HITL parity - #138
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Addressed in 72df83e (with follow-up nits in 07b6d7f and 8dc0de1). I switched always-approve to a dedicated wrapper content type ( |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by Go API Consistency Review Agent for issue #138 · ● 704.8K
Quim Muntal (qmuntal)
left a comment
There was a problem hiding this comment.
Looks good! Some minor comments,
|
Copilot linter failures |
|
Copilot resolve this merge conflict |
- Add toolapproval middleware (agent/middleware/toolapproval) implementing the .NET ToolApprovalAgent pattern: surfaces approval requests one at a time, queues remaining requests in session state, and supports standing 'don't ask again' rules that auto-approve matching tool calls - Add AlwaysApproveTool and AlwaysApproveToolWithArgs fields to FunctionApprovalResponseContent for standing rule signaling - Add AlwaysApproveToolResponse() and AlwaysApproveToolWithArgsResponse() convenience methods on FunctionApprovalRequestContent - Add tests for passthrough, surfacing, queuing, always-approve rules
Agent-Logs-Url: https://github.com/microsoft/agent-framework-go/sessions/860e5395-4285-450a-96c8-30377fae60b7 Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/agent-framework-go/sessions/860e5395-4285-450a-96c8-30377fae60b7 Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/agent-framework-go/sessions/860e5395-4285-450a-96c8-30377fae60b7 Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/agent-framework-go/sessions/583c5f54-0804-4843-b063-4d0798f68698 Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/agent-framework-go/sessions/583c5f54-0804-4843-b063-4d0798f68698 Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/agent-framework-go/sessions/583c5f54-0804-4843-b063-4d0798f68698 Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/agent-framework-go/sessions/ed64645f-daba-4c24-8c9e-4ebc131a42c7 Co-authored-by: gdams <20224954+gdams@users.noreply.github.com>
acd2ffe to
edff1b0
Compare
Cross-Repo Consistency ReviewSummaryThe core Parity Gap:
|
…-in-workflow parity - Mark 'Tool approval' as Aligned: Go now has agent/middleware/toolapproval (PR #138) implementing the .NET ToolApprovalAgent pattern with standing rules, queued-request batching, and AlwaysApprove* response content. - Mark 'Agent in workflow' as Aligned: Go's workflowhosting.Config already has InterceptUserInputRequests and InterceptUnterminatedFunctionCalls, matching the .NET AIAgentHostOptions surface. - Add agent/middleware/toolapproval to the Go Feature Checklist. - Bump doc date to May 7, 2026. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…in-workflow parity (#164) * docs: update feature comparison for toolapproval middleware and agent-in-workflow parity - Mark 'Tool approval' as Aligned: Go now has agent/middleware/toolapproval (PR #138) implementing the .NET ToolApprovalAgent pattern with standing rules, queued-request batching, and AlwaysApprove* response content. - Mark 'Agent in workflow' as Aligned: Go's workflowhosting.Config already has InterceptUserInputRequests and InterceptUnterminatedFunctionCalls, matching the .NET AIAgentHostOptions surface. - Add agent/middleware/toolapproval to the Go Feature Checklist. - Bump doc date to May 7, 2026. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary
Adds a
toolapprovalmiddleware package for .NETToolApprovalAgentparity, closing the primary Human-in-the-Loop gap identified in the feature comparison.New:
agent/middleware/toolapprovalToolApprovalAgentpattern as idiomatic Go middlewareAlwaysApproveToolResponse()orAlwaysApproveToolWithArgsResponse()to create rules that auto-approve matching future tool calls for the session lifetimeagent.SessionChanges to
messagepackageAlwaysApproveToolandAlwaysApproveToolWithArgsfields toFunctionApprovalResponseContentAlwaysApproveToolResponse()andAlwaysApproveToolWithArgsResponse()convenience methods onFunctionApprovalRequestContentTests