Skip to content

fix: preserve signed tool approval metadata across approval responses - #16592

Merged
lgrammel merged 2 commits into
mainfrom
bugfix/16334-1
Jul 6, 2026
Merged

fix: preserve signed tool approval metadata across approval responses#16592
lgrammel merged 2 commits into
mainfrom
bugfix/16334-1

Conversation

@lgrammel

@lgrammel lgrammel commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Background

Signed human-in-the-loop tool approvals failed on resume because the UI helper discarded the server-issued approval signature when recording a user decision.

Summary

Updated addToolApprovalResponse to append approved/reason onto the existing approval envelope instead of replacing it, preserving signature and isAutomatic metadata.

Testing

Kept the focused regression test in packages/ai/src/ui/chat.test.ts that verifies signed approval metadata survives the approval-requested to approval-responded transition, and added a patch changeset for ai.

Related Issues

Fixes #16334

@rpelevin

This comment was marked as spam.

@lgrammel

lgrammel commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

@rpelevin plesae turn off your ai response bot

@lgrammel
lgrammel merged commit a8f9b6d into main Jul 6, 2026
54 checks passed
@lgrammel
lgrammel deleted the bugfix/16334-1 branch July 6, 2026 07:49
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
ai 7.0.16 github npm
@ai-sdk/angular 3.0.16 github npm
@ai-sdk/harness 1.0.19 github npm
@ai-sdk/harness-claude-code 1.0.19 github npm
@ai-sdk/harness-codex 1.0.20 github npm
@ai-sdk/harness-deepagents 1.0.18 github npm
@ai-sdk/harness-opencode 1.0.19 github npm
@ai-sdk/harness-pi 1.0.19 github npm
@ai-sdk/langchain 3.0.16 github npm
@ai-sdk/llamaindex 3.0.16 github npm
@ai-sdk/otel 1.0.16 github npm
@ai-sdk/policy-opa 1.0.16 github npm
@ai-sdk/react 4.0.17 github npm
@ai-sdk/rsc 3.0.16 github npm
@ai-sdk/sandbox-just-bash 1.0.19 github npm
@ai-sdk/sandbox-vercel 1.0.19 github npm
@ai-sdk/svelte 5.0.16 github npm
@ai-sdk/tui 1.0.16 github npm
@ai-sdk/vue 4.0.16 github npm
@ai-sdk/workflow 1.0.16 github npm
@ai-sdk/workflow-harness 1.0.19 github npm
@ai-sdk/xai 4.0.7 github npm

gr2m added a commit that referenced this pull request Jul 6, 2026
…sponses (#16796)

Backport of #16592 to `release-v6.0` (clean cherry-pick). `chat.ts`
dropped the signature/metadata by reconstructing the approval object; v6
supports signed tool approvals.

Part of the v6.0 backport tracking issue #16767.

---------

Co-authored-by: Lars Grammel <lars.grammel@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

experimental_toolApprovalSecret: addToolApprovalResponse drops the approval signature, breaking every signed approval on resume

2 participants