Skip to content

Studio: clarify tool permission controls#7181

Open
shimmyshimmer wants to merge 2 commits into
mainfrom
agent/clarify-permission-mode-controls
Open

Studio: clarify tool permission controls#7181
shimmyshimmer wants to merge 2 commits into
mainfrom
agent/clarify-permission-mode-controls

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

Summary

  • rename the misleading Off mode to Run automatically
  • rename user-facing Bypass permissions controls to Tool permissions
  • keep the current permission mode visible in the composer
  • make selecting the active mode idempotent
  • remove the nested interactive off switch from the composer button
  • keep compact pill counts aligned with what is rendered
  • share the Full access warning across both confirmation dialogs

Why

This is a frontend follow-up to #7079.

The off value does not disable tool execution. It runs tool calls automatically inside the sandbox, so the Off label hid an important behavior. The composer also hid the permission pill in that mode, selecting the active row silently changed the mode, and the pill placed a second interactive control inside its dropdown button.

The updated controls show the active policy at all times, describe each mode by what it does, and require an explicit menu choice for every permission change.

Validation

  • npm run typecheck
  • npm run i18n:check
  • npm run build

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request rebrands "Bypass permissions" to "Tool permissions" across the user interface, renames the "Off" permission level to "Run automatically", and reorders the permission options so that "Full access" is positioned last. Additionally, it removes the ability to dismiss the permission pill directly from the composer and simplifies the pill compacting logic. Feedback is provided regarding the pillsCompact calculation in thread.tsx, which should account for whether the RAG tool is disabled to ensure consistent pill collapsing behavior.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +1438 to 1442
// More than 4 pills: collapse to icons only. Search, Code, and permissions
// always show; Images, RAG, Canvas and MCP are conditional.
const pillsCompact =
2 +
(permissionMode !== "off" ? 1 : 0) +
3 +
(ragEnabled ? 1 : 0) +

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.

medium

The pillsCompact calculation in thread.tsx counts the RAG pill whenever ragEnabled is true. However, if the active model does not support tools or is an external model, the RAG pill is disabled and hidden (ragDisabled is true). To ensure consistency with shared-composer.tsx and prevent incorrect pill collapsing, we should retrieve ragDisabled using the useRagToolDisabled() hook and check !ragDisabled in the calculation.

Suggested change
// More than 4 pills: collapse to icons only. Search, Code, and permissions
// always show; Images, RAG, Canvas and MCP are conditional.
const pillsCompact =
2 +
(permissionMode !== "off" ? 1 : 0) +
3 +
(ragEnabled ? 1 : 0) +
const ragDisabled = useRagToolDisabled();
// More than 4 pills: collapse to icons only. Search, Code, and permissions
// always show; Images, RAG, Canvas and MCP are conditional.
const pillsCompact =
3 +
(ragEnabled && !ragDisabled ? 1 : 0) +

@shimmyshimmer shimmyshimmer marked this pull request as ready for review July 16, 2026 13:38
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 14f17a7de8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d7b582fd6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


- name: Cross-browser permission controls
run: |
bash .github/scripts/run-studio-permission-browser.sh 18893 firefox

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include the permission helper in UI CI triggers

This new step depends on .github/scripts/run-studio-permission-browser.sh, but the workflow's pull_request.paths list only includes the app/test directories and this YAML, not the new helper script. A PR that changes only the helper can therefore alter the command these browser runs execute without running Studio UI CI, so regressions in the helper won't be caught until another workflow trigger happens; add the helper path to the trigger list.

Useful? React with 👍 / 👎.

- name: Cross-browser permission controls
run: |
bash .github/scripts/run-studio-permission-browser.sh 18895 webkit
bash .github/scripts/run-studio-permission-browser.sh 18895 chromium chrome

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid Chrome-channel runs with the pinned Mac driver

In this macos-14 job, the install step pins Playwright to >=1.55,<1.58, but this new run launches the runner's branded Chrome via channel='chrome'. Playwright 1.57's release notes list Google Chrome 139 as the tested stable channel, while the current GitHub macos-14 runner image lists Chrome 149, so this check can fail or become flaky from a browser/protocol mismatch; use the bundled Chromium here or update/unpin Playwright before adding a Chrome-channel run.

Useful? React with 👍 / 👎.

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.

1 participant