tui: permission prompt does not display message set by permission.evaluate hook

Open Beginner friendly
#67,437 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ningsiyuan1024 is already working on this.

Since Dec 1, 2026.

  • #67631 by @bbabi0901 — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Trace the TUI permission prompt that renders Permission required and inspect how it receives Permission.Request. Start by searching the TUI code for that prompt and for request.message; the issue identifies the permission.asked event as carrying the message. Done when the prompt displays the supplied message for an escalated request.

Written by the indexing model from the issue text.

Description

area/tui platform/macos status/repro-simulated type/bug version/v2

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

  1. Register a server plugin with a permission.evaluate hook that escalates an action to ask with 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)"
      }
    })
    
  2. Trigger a shell tool call in a TUI session.
  3. 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 ./tui plugin that reads context.data.session.permission.list(sessionID) and renders request.message in the session.composer.top slot above the prompt.
Dominant language
TypeScript
Stars
230k
Forks
31.3k
Avg merge
6h 58m
Merged PRs (30d)
471

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.