[FEATURE]: Deny tool use with message for llm #4752

Closed
opened 2026-02-16 17:45:16 -05:00 by yindo · 1 comment
Owner

Originally created by @podliy16 on GitHub (Jan 11, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Currently, permission requests must be answered with only one of three values: "once", "always", or "reject".
It would be useful to support additional context — particularly for rejections — so the LLM can adapt its strategy.

The Claude Agent SDK has a similar feature:
https://platform.claude.com/docs/en/agent-sdk/user-input

When allowing, pass the tool input (original or modified). When denying, provide a message explaining why. Claude sees this message and may adjust its approach.

My use case:
I have documentation stored in GitLab as Markdown files, so a typical task might be:
“Do XXX using documentation GITLAB_LINK”.

However, OpenCode cannot access GitLab directly because authentication is required. I want to reject such web-fetch tool requests and instead instruct the agent to use the glab CLI, which is already installed and configured in my environment.

This workflow worked for me in Claude Code, but I cannot replicate it in OpenCode due to the current permission response limitations.

If you're interested in this feature, I can try implementing it in OpenCode myself.

Originally created by @podliy16 on GitHub (Jan 11, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request Currently, permission requests must be answered with only one of three values: "once", "always", or "reject". It would be useful to support additional context — particularly for rejections — so the LLM can adapt its strategy. The Claude Agent SDK has a similar feature: https://platform.claude.com/docs/en/agent-sdk/user-input > When allowing, pass the tool input (original or modified). When denying, provide a message explaining why. Claude sees this message and may adjust its approach. **My use case:** I have documentation stored in GitLab as Markdown files, so a typical task might be: “Do XXX using documentation GITLAB_LINK”. However, OpenCode cannot access GitLab directly because authentication is required. I want to reject such web-fetch tool requests and instead instruct the agent to use the glab CLI, which is already installed and configured in my environment. This workflow worked for me in Claude Code, but I cannot replicate it in OpenCode due to the current permission response limitations. If you're interested in this feature, I can try implementing it in OpenCode myself.
yindo added the discussion label 2026-02-16 17:45:16 -05:00
yindo closed this issue 2026-02-16 17:45:16 -05:00
Author
Owner

@podliy16 commented on GitHub (Jan 13, 2026):

Okay, I dug deeper into Claude's implementation. The "reject with message" feature essentially means "stop execution and send a new user message with the reject reason." I've reimplemented this flow in OpenCode using two subsequent API calls:

  1. Reject the permission.
  2. prompt_async with the reject reason.

I think this feature doesn't make sense anymore, but maybe it would be helpful to include something along these lines in the documentation.

@podliy16 commented on GitHub (Jan 13, 2026): Okay, I dug deeper into Claude's implementation. The "reject with message" feature essentially means "stop execution and send a new user message with the reject reason." I've reimplemented this flow in OpenCode using two subsequent API calls: 1. Reject the permission. 2. prompt_async with the reject reason. I think this feature doesn't make sense anymore, but maybe it would be helpful to include something along these lines in the documentation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4752