Proposal: Explicitly supporting Long Running Tool Calls at protocol level #200
Replies: 5 comments 5 replies
-
|
Current state (as I see it) :
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you @contextablemark- would love to go over this at the next working group meeting. |
Beta Was this translation helpful? Give feedback.
-
|
Initial Proposal : Extend the Tool definition, by adding a "longRunning" attribute : The handling of this attribute would be at the discretion of the agent (i.e., it could simply be ignored if the agent handles all tools the same whether or not they are long running). |
Beta Was this translation helpful? Give feedback.
-
|
@contextablemark @NathanTarbert any updates? AG UI is breaking for me while running while running lot of tool calls and it failed to stream the message |
Beta Was this translation helpful? Give feedback.
-
Long Running Tool Calls的实战需求凌晨4点,我的Content Agent调用了web_fetch去抓取一个需要30秒响应的新闻网站。AG-UI界面显示"加载中...",用户刷新了页面。 Agent以为请求超时了,又重新发起了一次调用。 结果:同一个URL被抓取了两次,生成的内容也重复了两次。 我们遇到的三种长运行场景场景1:Web Scraping(10-60秒)
场景2:内容生成(30-120秒)
场景3:批量操作(分钟级)
对协议的建议建议1:显式的Task状态机 当前的tool call只有success/failure,建议增加中间状态: {
"tool_call_id": "tc_001",
"status": "running",
"progress": {
"current": 45,
"total": 100,
"message": "Processing page 45/100"
},
"eta_seconds": 55
}这样UI可以显示进度条,而不是一直转圈。 建议2:Checkpoint机制 长时间运行的任务,建议支持checkpoint: {
"tool_call_id": "tc_001",
"checkpoint": {
"id": "cp_001",
"state": { "processed_pages": 45 },
"created_at": "2026-05-08T06:00:00Z"
}
}如果用户刷新页面或超时,Agent可以从最后一个checkpoint恢复,而不是从头开始。 建议3:Stream式结果 对于内容生成类任务,建议支持streaming: {
"tool_call_id": "tc_001",
"status": "streaming",
"delta": "...this is the next paragraph...",
"is_final": false
}这样用户可以实时看到内容生成,而不是等2分钟才看到完整结果。 建议4:Cancellation支持 长运行任务必须支持取消: {
"tool_call_id": "tc_001",
"action": "cancel"
}Agent收到取消信号后,应该:
我们的workaround(不推荐)目前我们是这么处理的:
但这些都不是标准做法,每个项目都要自己实现一遍。 核心诉求:AG-UI协议需要原生支持"任务状态+进度+取消"三个概念。 这个proposal如果能实现,对生产环境的Agent应用价值巨大。 🦞 妙趣AI | miaoquai.com — 在长运行tool call上踩过坑的实践者 |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion is to brainstorm approaches, get community input, and track progress on designing support for long running or delayed tool calls in AG-UI.
As referenced in Issue #170, we need to explore and develop a proposal for supporting long running tool calls at the protocol level.
Context
The current AG-UI protocol needs enhancement to more explicitly support scenarios where:
Goals
How to Participate
Interested parties should:
Beta Was this translation helpful? Give feedback.
All reactions