fix(providers): surface OpenCode dynamic approval requests - #7788
fix(providers): surface OpenCode dynamic approval requests#7788triamazikamno wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 460b7fb. Configure here.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces new capability for surfacing dynamic tool approval requests with enriched details. The changes affect core provider orchestration behavior and how approval requests are classified and displayed to users, warranting human review. You can add or adjust custom eligibility rules. Learn more. |
cb492c3 to
05ee826
Compare

What Changed
unknownOpenCode approvals actionable on web and mobile.Why
OpenCode can emit permission types such as
glob,grep, or external tool names that T3 Code previously classified asunknown. Clients did not treat those requests as actionable, leaving the thread stuck in an Approval state without response controls.OpenCode can also emit the permission request before the corresponding tool input is populated. The adapter now correlates the exact tool call and performs a bounded, abortable lookup for its arguments. If enrichment fails or exceeds 250 ms, the approval still appears with the available permission scope.
Approval details are normalized at the provider boundary. For example:
glob: *.mdgrep: OpenCodeskill: fix-reviewgh_grep_searchGitHubwith its structured argumentsThe complete display detail is capped at 2,000 characters, while the structured arguments remain intact.
UI Changes
Before, OpenCode threads could remain stuck in Approval without actionable controls, or show only an ambiguous pattern such as
*.md.After, the approval includes response controls and identifies both the tool and requested scope.
Verification
Checklist
Implemented with Codex (
gpt-5.6-sol) through the T3 Code Codex harness.Note
Medium Risk
Touches provider permission mapping and approval UX, including a timed SDK fetch on the event path. Does not change auth or filesystem policy, but a mapping/timeout bug could still stall or mislabel approvals.
Overview
Makes OpenCode permissions that are not bash/read/edit actionable instead of classifying them as
unknownand leaving threads stuck in Approval.The adapter now maps those permissions to
dynamic_tool_call, labels them with the tool/skill name and scope, and attaches structured args when available. If the permission arrives before tool input is populated, it looks up the matching tool part (cached first, then a 250ms abortablesession.messagefetch) and still emits the approval on timeout. Display details are capped at 2,000 characters.Ingestion stamps these as command approvals. Web and mobile also treat persisted
unknownrequest types as command so older OpenCode approvals remain respondable.Reviewed by Cursor Bugbot for commit 05ee826. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Surface OpenCode dynamic tool approvals and fix legacy 'unknown' request classification
dynamic_tool_callrequest type and emitsrequest.openedwith enriched details (tool name, pretty-printed args) merged from tool input and metadatasession.messagebut is bounded to 250 ms (OPENCODE_PERMISSION_ENRICHMENT_TIMEOUT_MS); on timeout it falls back to metadata-only and aborts the fetch. Details are truncated to 2000 charactersrunOpenCodeSdkto pass anAbortSignalinto the callback so SDK calls can be cancelled on timeoutrequestKindFromRequestTypeinsession-logic.ts,threadActivity.ts, andProviderRuntimeIngestion.tsto classify legacyunknownanddynamic_tool_callrequest types ascommandinstead of dropping themmapPermissionToRequestTypeinOpenCodeAdapter.tsnow returnsdynamic_tool_callinstead ofunknownfor non-standard permissions; any downstream consumer expectingunknownwill no longer see itMacroscope summarized 05ee826.