anomalyco / anomalyco/opencode

[FEATURE]: --format json mode should emit permission_asked events for headless integrations

Open
#39,459 1 comment 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Jul 29, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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

When OpenCode runs in --format json non-interactive headless mode, permission_asked events are silently auto-rejected. The event is never emitted to stdout, so external tools (like cc-connect) cannot relay permission verification cards to users.

This forces headless integrators to choose between --dangerously-skip-permissions (allow all tools) or auto-reject all permissions with no user notification. There is no way to ask the user for permission via the JSON output channel.

The proposal is to emit permission_asked NDJSON events to stdout in --format json mode and accept permission replies via stdin, enabling headless tools to bridge permission prompts to external UIs.

Related
  • chenhg5/cc-connect#1420 — cc-connect bug caused by this missing functionality

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.