tui: permission prompt does not display message set by permission.evaluate hook
维护者通常 1 天内回复
@ningsiyuan1024 已经在做这个了。
开始于 2026年12月1日。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
跟踪显示 Permission required 的 TUI 权限提示,并检查它如何接收 Permission.Request。首先在 TUI 代码中搜索该提示和 request.message;issue 指出携带消息的是 permission.asked 事件。对于已升级的请求,提示显示提供的消息后即完成。
由索引模型根据 Issue 内容生成。
描述
Summary
When a server plugin sets event.message in a permission.evaluate hook and escalates to effect = "ask", OpenCode's server attaches message to Permission.Request and sends it in permission.asked, but the TUI permission prompt never renders it.
Environment
- opencode version: 2.4.3
- Client: TUI
- Model and provider: Not relevant
- OS: Darwin 25.6.0 (darwin arm64)
- Terminal: TERM_PROGRAM=ghostty, TERM=xterm-256color, COLORTERM=truecolor
- Shell: /bin/zsh
- Install/channel: latest
- Active plugins:
@mattietk/opencode-clef-guard@latest(opencode.json);@mattietk/opencode-queue-steer@latest,@mattietk/opencode-session-diff@latest,@mattietk/opencode-session-tree@latest(cli.json)
Reproduction
- Register a server plugin with a
permission.evaluatehook that escalates an action toaskwith a message:await ctx.permission.hook("evaluate", (event) => { if (event.action === "shell") { event.effect = "ask" event.message = "Flagged by policy (score 0.68 >= 0.40)" } }) - Trigger a
shelltool call in a TUI session. - Observe the permission prompt displayed in the TUI.
Expected Behavior
Per the Server plugins documentation ("message appears in an escalated permission request or becomes the denial reason"), the TUI permission prompt should display request.message so the user can see why the plugin escalated the action.
Actual Behavior
The TUI permission prompt only shows Permission required, the action/command details, and the approval options (Allow once, Allow always, Reject). request.message is never displayed, even though Permission.Request.message is present in the permission.asked event and in context.data.session.permission.list(sessionID).
Additional Context
- Reproducible consistently for every permission action (
shell,edit,webfetch,external_directory). - Workaround: shipping a companion
./tuiplugin that readscontext.data.session.permission.list(sessionID)and rendersrequest.messagein thesession.composer.topslot above the prompt.
- 主要语言
- TypeScript
- 星标
- 230k
- 派生
- 31.3k
- 平均合并
- 5 小时 59 分钟
- 30 天内合并 PR
- 473
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
area/web platform/ios type/bug
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#67504 · 1 条评论 ·
维护者通常 1 天内回复
-
area/tui platform/macos type/feature version/v2
难度 2/5 1-3 小时 新手友好度 83/100
anomalyco/opencode#67490 · 1 条评论 ·
维护者通常 1 天内回复
-
Plain source starting with `let ftype` is attached as video/mp4可能重新可做 关联的 PR 已关闭且未合并。 未关闭area/core platform/macos status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#67448 · 1 条评论 ·
维护者通常 1 天内回复
-
area/desktop type/feature
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#67414 · 1 条评论 ·
维护者通常 1 天内回复
-
area/desktop platform/macos type/feature version/v2
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#67266 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
MTES-MCT/monitorenv#3257 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
salesforce/sa11y#1022 ·
-
Kartographer map markers lose their geo: link on non-English wikis可能已有人在做 @playlikeboy 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
openzim/mwoffliner#3014 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
ardia-browser/ardia#5810 ·
维护者通常 1 天内回复