[Bug]:权限系统,触发ASK , 用户拒绝后,tool_result能否支持携带用户拒绝原因 ,并且拒绝后没有对应的tool_result事件产生
1.当前拒绝后,工具会返回固定的消息:Permission denied by user ,不够灵活,能否在 io.agentscope.core.event.ConfirmResult 加一个字段用于自定义这个内容,或者复用Msg的textContent
- ASK权限手动触发拒绝后,没有发送对应的ToolResultStartEvent、ToolResultTextDeltaEvent、ToolResultEndEvent 事件(框架自动拒绝的情况有发送)。
I'd like to work on this. Both points verified in code:
-
The denial text is hardcoded at the manual-deny path in
ReActAgent.applyConfirmResults(ToolResultBlock.text("Permission denied by user")). Plan: add an optionalreasonfield toConfirmResult(backward compatible — existing constructors keep working), and use it as the tool result text when present. -
Confirmed asymmetry: the rule-based auto-deny path emits
ToolResultStartEvent → ToolResultTextDeltaEvent → ToolResultEndEvent, while the manual-deny path only writes the DENIEDToolResultBlockinto 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.
我也有自定义reason的诉求,这个还没有合并到主干吗?