Skip to content

Handle recoverable tool argument errors in graceful exit resume#239

Open
yuzhichang wants to merge 2 commits into
cloudwego:mainfrom
yuzhichang:fix_cancel
Open

Handle recoverable tool argument errors in graceful exit resume#239
yuzhichang wants to merge 2 commits into
cloudwego:mainfrom
yuzhichang:fix_cancel

Conversation

@yuzhichang

Copy link
Copy Markdown

Summary

  • return tool argument/schema errors as recoverable tool results during analyst tool execution
  • keep non-argument tool errors fatal instead of masking them as retryable
  • track run completion/cancel/failure explicitly so resume no longer prints success after a failed run

Testing

  • go build ./adk/cancel/graceful-exit

Copilot AI review requested due to automatic review settings June 8, 2026 05:46
@CLAassistant

CLAassistant commented Jun 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the graceful-exit demo to provide clearer event output and more robust handling of cancellations and tool-argument errors during agent runs.

Changes:

  • Added a tool middleware to convert tool argument unmarshalling/type errors into tool results (instead of failing the run).
  • Improved event stream printing with numbered headers, mode/agent/role labels, and tool-call visibility for streamed and non-streamed messages.
  • Refactored run termination handling to return explicit run statuses (completed/canceled/failed) for both initial run and resume.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread adk/cancel/graceful-exit/main.go Outdated
Comment thread adk/cancel/graceful-exit/main.go
Comment thread adk/cancel/graceful-exit/main.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants