fix(web): local-mode permission UX + stop OpenCode 500 spam#1054
Open
DullJZ wants to merge 2 commits into
Open
fix(web): local-mode permission UX + stop OpenCode 500 spam#1054DullJZ wants to merge 2 commits into
DullJZ wants to merge 2 commits into
Conversation
Local sessions mirror pending permissions but have no approval RPC. Stop presenting Allow/Deny (and voice approval) as if remote control works.
Local OpenCode does not register session RPCs for model and reasoning effort lists, so active local sessions were spamming hub 500s.
There was a problem hiding this comment.
Findings
No findings.
Summary
Review mode: initial
Reviewed the full diff for local-mode permission UX and OpenCode model/effort query gating. No correctness, security, data-loss, performance, or maintainability issue met the reporting threshold. Residual risk: I could not execute the new Vitest coverage in this runner because bun is not installed.
Testing
Not run (automation): bun not found on PATH when attempting bun test web/src/components/ToolCard/PermissionFooter.test.tsx web/src/realtime/realtimeClientTools.test.ts.
HAPI Bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Local mode (
agentState.controlledByUser === true) cannot remotely approve permissions or list OpenCode models/effort options (no session RPC handlers). The web UI still presented those controls and polled those endpoints, which looked broken and flooded the hub with 500s.This PR makes local mode honest in the UI and stops the useless session RPCs.
Commits
fix(web): hide remote permission actions in local modefix(web): skip OpenCode model/effort queries in local modeProblem
1) Local OpenCode looks remotely approvable
permission.askedintoagentState.requests, so the web shows pending permissions.permissionis remote-only.2) Local OpenCode floods hub with 500s
SessionChat enabled:
GET /api/sessions/:id/opencode-modelsGET /api/sessions/:id/opencode-reasoning-effort-optionsfor every active OpenCode session, including local.
Those handlers exist only in the remote launcher.
Missing handler →
RpcTargetMissingError→ HTTP 500.React Query retry + 1s discovery polling multiplies the noise.
Changes
Permission UX (local mode)
controlledByUserthrough chat context → tool cards.PermissionFooterAskUserQuestionFooterRequestUserInputFooterapprovePermission/denyPermissionwhen localOpenCode query gating (local mode)
&& !controlledByUser, matching existing Grok/Codex local gating:useOpencodeModelsuseOpencodeReasoningEffortOptionsOut of scope