agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

[Bug]:权限系统,触发ASK , 用户拒绝后,tool_result能否支持携带用户拒绝原因 ,并且拒绝后没有对应的tool_result事件产生

Open qu-yquan opened this issue 4 months ago • 2 comments

1.当前拒绝后,工具会返回固定的消息:Permission denied by user ,不够灵活,能否在 io.agentscope.core.event.ConfirmResult 加一个字段用于自定义这个内容,或者复用Msg的textContent

Image
  1. ASK权限手动触发拒绝后,没有发送对应的ToolResultStartEvent、ToolResultTextDeltaEvent、ToolResultEndEvent 事件(框架自动拒绝的情况有发送)。

qu-yquan avatar Jul 30 '26 01:07 qu-yquan

I'd like to work on this. Both points verified in code:

  1. The denial text is hardcoded at the manual-deny path in ReActAgent.applyConfirmResults (ToolResultBlock.text("Permission denied by user")). Plan: add an optional reason field to ConfirmResult (backward compatible — existing constructors keep working), and use it as the tool result text when present.

  2. Confirmed asymmetry: the rule-based auto-deny path emits ToolResultStartEvent → ToolResultTextDeltaEvent → ToolResultEndEvent, while the manual-deny path only writes the DENIED ToolResultBlock into context without emitting any events. Plan: emit the same event triple for manually denied tool calls on resume, carrying the denial reason as the delta text.

Will keep the change focused on these two points with regression tests for both.

liulangjietou avatar Aug 04 '26 02:08 liulangjietou

我也有自定义reason的诉求,这个还没有合并到主干吗?

tcsp avatar Sep 21 '26 04:09 tcsp