Repository navigation
fix(app): restore shell permission description - #59405
ZXLyyds100 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
The fix addresses the real cause. The dock looks up settings.permissions.tool.<action>.description, and only bash.* existed. I couldn't render the dock here (no browser for Playwright). Instead I checked the dictionaries directly: on the base branch the shell description key resolves to undefined, both in English and in another locale merged over English (the way language.tsx builds it). With this PR it resolves to "Run shell commands". The i18n unit tests pass.
Public API: unchanged. This is app-internal i18n only.
One thing worth fixing: only en.ts gets the new keys, so every other locale shows the English text for shell prompts. At the same time, the existing translated settings.permissions.tool.bash.* strings in the ~60 other locale files become dead, because the dock is the only reader of these keys. See the inline comment.
Related: #51519
| "settings.permissions.tool.list.description": "List files within a directory", | ||
| "settings.permissions.tool.bash.title": "Bash", | ||
| "settings.permissions.tool.bash.description": "Run shell commands", | ||
| "settings.permissions.tool.shell.title": "Shell", |
There was a problem hiding this comment.
Only the permission dock reads settings.permissions.tool.*, and the server now always sends action: "shell". So the bash.* keys are dead, and the other locales keep translated bash strings (e.g. de: "Shell-Befehle ausführen", zh: "运行 shell 命令") while falling back to English for shell. Could you rename settings.permissions.tool.bash.* to settings.permissions.tool.shell.* in en.ts and in every locale file instead of adding a second pair? It's a mechanical rename, and non-English users would get their translation.
There was a problem hiding this comment.
I kept this patch English-source-only per packages/app/AGENTS.md: new feature/fix strings are added to en.ts, while non-English keys are left absent so the runtime English fallback applies until language review. Renaming roughly 60 locale files would be a broader translation-maintenance change and would need that review workflow; it is outside this issue’s minimal fix. The existing bash keys remain for compatibility with any other callers, while shell now resolves for the server action used by the dock.
Issue for this PR
Closes #59377
Type of change
What does this PR do?
Shell permission requests use
action: "shell", but the app only had the legacybashpermission description keys. The permission dock therefore rendered the command list without its explanatory line.This adds the
shelltitle/description keys and extends the existing permission-dock regression to assert the visible “Run shell commands” line. MCP and other permission actions are unchanged.How did you verify your code works?
npx --yes [email protected] run test:e2e -- e2e/regression/session-request-docks.spec.ts --grep "shows a pending permission dock" --project chromium— 1 passednpx --yes [email protected] run test:unit -- src/runtime/i18n/language.test.ts— 898 passed, 0 failed across 126 files. The expecteddisk fullandECONNRESETdiagnostics were logged by existing tests.npx --yes [email protected] run typecheck— 1,734 files, 0 errorsnpx --yes [email protected] run check— 35/35 typecheck tasks passed, 0 errors; 1,641 existing lint warnings remain.git diff --check— passed.Visual
Screenshots / recordings
Real OpenCode dev app, Chromium, and the same
shellpermission fixture (git statusandgit diff) were used for both captures. The before/after captures were made from the baseline0749024f0d6f6bb3014850a820d06677b7c37120plus this small patch, before the PR branch was synced with unrelated upstream commits; the focused and full checks above were rerun on the final PR commit.Evidence files are hosted on the fork-only
visual-evidence-59377branch and are not part of this PR's source diff.Checklist
Implemented and verified with OpenAI Codex assistance. No independent human review or hosted CI success is implied.
Added by the opencode bot (AI-generated).
Related: #51519