Skip to content

feat(runtime/events): 新增 PermissionRequest / PermissionResolved 运行时事件#159

Merged
minorcell merged 5 commits into
1024XEngineer:mainfrom
Cai-Tang-www:P0-7
Apr 5, 2026
Merged

feat(runtime/events): 新增 PermissionRequest / PermissionResolved 运行时事件#159
minorcell merged 5 commits into
1024XEngineer:mainfrom
Cai-Tang-www:P0-7

Conversation

@Cai-Tang-www

Copy link
Copy Markdown
Collaborator

Summary

  • 在 runtime 新增事件类型:permission_requestpermission_resolved
  • 新增结构化 payload:PermissionRequestPayloadPermissionResolvedPayload,统一输出 tool/action/decision/reason/rule 等字段。
  • 在工具执行返回权限决策错误时发事件:
    • ask:先发 PermissionRequest,再发 PermissionResolved
    • deny:发 PermissionResolved
  • 扩展 tools.PermissionDecisionError 的结构化访问能力(Action/Reason/RuleID),供 runtime 事件构建复用。
  • 补充 runtime 与 tools 测试覆盖 ask/deny 事件链路和字段断言。

Test

  • go test ./internal/runtime ./internal/tools
  • go test ./...

Closes #158
Refs #98

@minorcell minorcell merged commit 8d6cecc into 1024XEngineer:main Apr 5, 2026
2 checks passed
@Cai-Tang-www Cai-Tang-www deleted the P0-7 branch April 5, 2026 07:41
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.

feat(runtime/events): 新增 PermissionRequest / PermissionResolved 运行时事件

2 participants