[dotnet-port] Align tool approval response snapshots#279
Conversation
Snapshot tool-call content when creating approval responses so the approved call remains stable if the original request content is mutated before execution or serialization. This mirrors the upstream .NET workflow approval snapshot behavior from microsoft/agent-framework#6427. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates tool-approval response creation to snapshot (clone) tool-call content and relevant headers at the time the approval response is created, so later mutations to the original request/tool-call object don’t change what ultimately gets approved/serialized—aligning behavior with the referenced upstream .NET workflow.
Changes:
- Clone
ToolApprovalRequestContent.ToolCallwhen building an approval response to make approvals stable against later mutations. - Clone
ContentHeader.AdditionalPropertiesandAnnotationswhen building approval responses. - Add tests validating snapshot behavior for both
FunctionCallContentandMCPServerToolCallContent.
Show a summary per file
| File | Description |
|---|---|
| message/content.go | Clones tool-call content and header fields when creating tool-approval responses. |
| message/content_test.go | Adds tests ensuring approval responses are unaffected by subsequent mutations to the original tool call/request. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
API Consistency Review: ✅ AlignedChanged surface: What changed: Parity check vs .NET ( The referenced upstream PR #6427 added snapshot behavior at the declarative executor layer ( Parity check vs Python ( Python does not have a No parity issues found. The implementation approach is intentionally language-idiomatic (Go value-copy semantics,
|
Snapshot tool-call content when creating approval responses so the approved call remains stable if the original request content is mutated before execution or serialization. This mirrors the upstream .NET workflow approval snapshot behavior from microsoft/agent-framework#6427.