Skip to content

docs: Document tool approval denial reason propagation#2520

Merged
anubra266 merged 4 commits intomainfrom
docs-writer-ai-update-2026-03-04T18-29-20-955Z-yq1t14
Mar 4, 2026
Merged

docs: Document tool approval denial reason propagation#2520
anubra266 merged 4 commits intomainfrom
docs-writer-ai-update-2026-03-04T18-29-20-955Z-yq1t14

Conversation

@inkeep
Copy link
Copy Markdown
Contributor

@inkeep inkeep Bot commented Mar 4, 2026

Summary

Documents the improved tool approval denial reason propagation behavior introduced in #2500.

Changes

Visual Builder Tool Approvals

  • Updated runtime behavior section to clarify that agents receive a clean human-readable denial reason string (not raw JSON sentinels)
  • Added explanation that agents can use the denial reason to adapt their behavior

TypeScript SDK Tool Approvals

  • Added new "Denial reason propagation" subsection explaining:
    • Agents receive denial reasons as clean, human-readable strings
    • Agents can use these reasons to adapt behavior
    • Practical example of task redirection (e.g., "I want Tokyo instead")

Sub Agent Relationships

  • Added bullet point to the delegation relationships section explaining that parent agents now receive visibility into task redirects during delegation
  • Clarifies that delegation responses include notes about mid-execution redirects

Related PR

Closes documentation gap from #2500

cc @anubra266

inkeep Bot added 3 commits March 4, 2026 18:30
Document that parent agents now receive a note in the delegation
response when a user redirects a delegated sub-agent's task
mid-execution (e.g. by denying a tool call with a reason).
This gives the parent full context about how the task evolved.

Ref: PR #2500
@inkeep inkeep Bot requested a review from anubra266 March 4, 2026 18:32
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 4, 2026

⚠️ No Changeset found

Latest commit: 520b9ff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-docs Ready Ready Preview, Comment Mar 4, 2026 6:41pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
agents-api Ignored Ignored Preview Mar 4, 2026 6:41pm
agents-manage-ui Ignored Ignored Preview Mar 4, 2026 6:41pm

Request Review

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Mar 4, 2026

Documents how tool approval denial reasons propagate to agents, following the fix in #2500.

  • agents-docs/content/typescript-sdk/tools/tool-approvals.mdx — new "Denial reason propagation" subsection explaining that denied tool requests return a human-readable reason string the agent can act on
  • agents-docs/content/typescript-sdk/agent-relationships.mdx — adds a bullet to the delegation flow noting that user redirects (e.g. denying a tool call with a reason) are surfaced back to the parent sub agent
  • agents-docs/content/visual-builder/tools/tool-approvals.mdx — updates the denial step to clarify the agent receives a clean reason string and can adapt behavior

Pullfrog  | View workflow run | Using Claude Code | Triggered by Pullfrogpullfrog.com𝕏

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation is technically accurate and matches the #2500 implementation. Two suggestions below — one for precision, one for completeness.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow runpullfrog.com𝕏

Comment thread agents-docs/content/visual-builder/tools/tool-approvals.mdx Outdated
Comment on lines +56 to +61
### Denial reason propagation

When a user denies a tool request with a `reason`, the agent receives the denial reason as a clean, human-readable string. This allows the agent to understand why the request was denied and adapt its behavior — for example, trying a different approach based on the user's feedback.

This is especially useful for redirecting agents. If a user denies a request for "San Francisco weather" with the reason "I want Tokyo instead", the agent can immediately act on that feedback and fetch Tokyo weather without requiring a separate follow-up message.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This subsection covers the executing agent's experience (Bug 1 fix from #2500) but doesn't mention the delegation visibility fix (Bug 2) — parent agents also receive a note about denied tool calls during delegation. Consider adding a sentence like: "In delegation scenarios, the parent agent also receives a note summarizing any mid-execution redirects — see Sub Agent Relationships." This makes the tool-approvals doc self-contained for readers who don't navigate to agent-relationships.

Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
@anubra266 anubra266 enabled auto-merge (squash) March 4, 2026 18:39
@anubra266 anubra266 merged commit 9f5635a into main Mar 4, 2026
9 checks passed
@anubra266 anubra266 deleted the docs-writer-ai-update-2026-03-04T18-29-20-955Z-yq1t14 branch March 4, 2026 18:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

🔎💬 Inkeep AI search and chat service is syncing content for source 'Inkeep Agent Framework Docs'

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

(2) Total Issues | Risk: Low


🟡 Minor (1) 🟡

🟡 1) tool-approvals.mdx Code example doesn't demonstrate denial reason

Issue: The new "Denial reason propagation" subsection (lines 56-60) explains that denial reasons enable agents to adapt behavior, but the Vercel AI SDK code example on the same page (lines 146-161) shows denial without passing a reason field: addToolApprovalResponse({ id: part.approval.id, approved: false }). This creates a gap between the documented capability and the demonstrated usage.

Why: Developers following the code example won't see how to actually implement the redirection use case described in the new documentation. The example demonstrates the pattern but misses the key feature being documented.

Fix: Consider updating the existing "Deny" button example to include a reason parameter, demonstrating the full capability:

addToolApprovalResponse({
  id: part.approval.id,
  approved: false,
  reason: 'User wants different parameters', // Enables agent redirection
});

This makes the new documentation immediately actionable for developers following the example.

Refs:


💭 Consider (2) 💭

Inline Comments:

  • 💭 Consider: visual-builder/tools/tool-approvals.mdx:107 Inconsistent "for example" formatting vs TypeScript SDK page
  • 💭 Consider: typescript-sdk/agent-relationships.mdx:89 Long bullet point breaks parallel list structure

🕐 Pending Recommendations (1)

  • 🟡 tool-approvals.mdx pullfrog suggested adding a cross-reference to delegation visibility — the TypeScript SDK tool-approvals page could note that parent agents also receive redirect context during delegation (see Sub Agent Relationships)

💡 APPROVE WITH SUGGESTIONS

Summary: The documentation accurately reflects the #2500 implementation — denial reasons are cleanly propagated to agents, and parent agents gain visibility into delegation redirects. The main suggestion is to update the code example to demonstrate the denial reason capability alongside the documentation that explains it. The inline style suggestions are optional polish.


Discarded (2)
Location Issue Reason Discarded
agent-relationships.mdx:89 Missing comma after "e.g." Too nitpicky (LOW confidence) and both styles exist in codebase
visual-builder/tools/tool-approvals.mdx Could link to specific #denial-reason-propagation anchor Already has adequate cross-reference in "Handling approvals in your client" section
Reviewers (3)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-product 3 1 0 0 0 1 1
pr-review-consistency 3 0 2 0 2 0 1
pr-review-docs 1 0 0 0 0 0 0
Total 7 1 2 0 2 1 2

Note: pr-review-docs finding (bullet length) was merged with pr-review-consistency finding addressing the same issue.

3. The user approves or denies the request
4. If approved, the tool executes and the agent continues
5. If denied, the agent receives the denial and can respond accordingly
5. If denied, the agent receives a human-readable denial reason string (or a default message if no reason was provided), allowing it to understand why the request was denied and adapt its behavior (for example, trying a different approach or asking a clarifying question)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 Consider: Inconsistent "for example" formatting

Issue: This line uses (for example, in parentheses, while the parallel TypeScript SDK page uses em-dash formatting — for example,. Both styles exist in the codebase, but the em-dash pattern is more common in the docs.

Why: Consistency in formatting between parallel documentation pages helps developers build familiarity with the documentation style.

Fix: Consider aligning with the TypeScript SDK pattern:

Suggested change
5. If denied, the agent receives a human-readable denial reason string (or a default message if no reason was provided), allowing it to understand why the request was denied and adapt its behavior (for example, trying a different approach or asking a clarifying question)
5. If denied, the agent receives a human-readable denial reason string (or a default message if no reason was provided), allowing it to understand why the request was denied and adapt its behavior for example, trying a different approach or asking a clarifying question

Refs:

- The target Sub Agent executes a specific task
- Results are returned to the source Sub Agent
- The source Sub Agent continues processing
- If a user redirects the task mid-delegation (e.g. by denying a tool call with a reason like "I want Tokyo instead"), the delegation response includes a note about the redirect so the parent Sub Agent has full context about how the task evolved
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 Consider: Long bullet point breaks parallel structure

Issue: This bullet point (~50 words with nested parenthetical) is significantly longer than the other items in this list (6-10 words each). This breaks the scannable parallel structure of the delegation relationships list.

Why: The existing bullets follow a pattern of short, declarative statements that are easy to scan. This longer item may be skimmed over despite containing important information.

Fix: Consider splitting into a shorter bullet followed by a <Tip> or note that elaborates:

- User redirects mid-delegation are passed back to the source Sub Agent

<Tip>
When a user denies a tool call with a reason (e.g., "I want Tokyo instead"), the parent Sub Agent receives full context about how the delegated task evolved during execution.
</Tip>

Alternatively, keep the current format if the inline explanation is preferred for discoverability — this is a style preference.

Refs:

@github-actions github-actions Bot deleted a comment from claude Bot Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant