Skip to content

Conversation

@agents-git-bot
Copy link
Contributor

@agents-git-bot agents-git-bot bot commented Feb 3, 2026

Summary

Documentation sync for cloudflare/agents PR #829

Fixes duplicate assistant messages when using addToolApprovalResponse with tools that have needsApproval.

Problem

When a user approves a tool via addToolApprovalResponse and then calls sendMessage, two assistant messages were persisted with the same content but different IDs:

  • Original message with server-generated ID (msg_...) stuck in pending state
  • New message with client-generated ID in completed state

Solution

Wrap addToolApprovalResponse in server notification to update the message in place using the existing ID, preventing duplicates when sendMessage is called.

Changes

  • Add changelog entry documenting the bug fix
  • Update API reference with addToolApprovalResponse documentation
  • Add note to human-in-the-loop guide

Related


Automated documentation sync for cloudflare/agents#829

…lResponse

This syncs documentation for cloudflare/agents PR #829, which fixes
duplicate assistant messages when using addToolApprovalResponse with
tools that have needsApproval.

Changes:
- Add addToolApprovalResponse to useAgentChat API reference
- Document tool approval handling with example
- Update human-in-the-loop guide to explain the fix
- Add changelog entry for the bug fix

Related to: cloudflare/agents#829
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/pcx-technical-writing
/src/content/docs/agents/ @irvinebroque, @rita3ko, @elithrar, @thomasgauvin, @threepointone, @whoiskatrin, @cloudflare/pcx-technical-writing, @cloudflare/ai-agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. product:changelog size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants