Skip to content

fix(app): restore shell permission description - #59405

Open
ZXLyyds100 wants to merge 1 commit into
anomalyco:devfrom
ZXLyyds100:shell-permission-description
Open

ZXLyyds100 wants to merge 1 commit into
anomalyco:devfrom
ZXLyyds100:shell-permission-description

Conversation

@ZXLyyds100

@ZXLyyds100 ZXLyyds100 commented Oct 26, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #59377

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Shell permission requests use action: "shell", but the app only had the legacy bash permission description keys. The permission dock therefore rendered the command list without its explanatory line.

This adds the shell title/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?

  • Focused Chromium regression: npx --yes [email protected] run test:e2e -- e2e/regression/session-request-docks.spec.ts --grep "shows a pending permission dock" --project chromium — 1 passed
  • App unit suite command: npx --yes [email protected] run test:unit -- src/runtime/i18n/language.test.ts — 898 passed, 0 failed across 126 files. The expected disk full and ECONNRESET diagnostics were logged by existing tests.
  • App typecheck: npx --yes [email protected] run typecheck — 1,734 files, 0 errors
  • Repository check: npx --yes [email protected] run check — 35/35 typecheck tasks passed, 0 errors; 1,641 existing lint warnings remain.
  • git diff --check — passed.

Visual

<svg width="240" height="72" viewBox="0 0 240 72" xmlns="http://www.w3.org/2000/svg">
  <rect x="1" y="1" width="238" height="70" rx="8" fill="none" stroke="currentColor" opacity=".25"/>
  <circle cx="18" cy="22" r="5" fill="currentColor" opacity=".65"/>
  <text x="32" y="26" fill="currentColor" font-family="sans-serif" font-size="12">Permission required</text>
  <text x="32" y="48" fill="currentColor" opacity=".55" font-family="sans-serif" font-size="11">Run shell commands</text>
  <animate attributeName="opacity" values=".55;1;.55" dur="1.8s" repeatCount="indefinite"/>
</svg>

Screenshots / recordings

Real OpenCode dev app, Chromium, and the same shell permission fixture (git status and git diff) were used for both captures. The before/after captures were made from the baseline 0749024f0d6f6bb3014850a820d06677b7c37120 plus 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.

Before After
Permission dock before Permission dock after

Evidence files are hosted on the fork-only visual-evidence-59377 branch and are not part of this PR's source diff.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: shell permission prompt has no description (missing settings.permissions.tool.shell i18n key)

1 participant