Skip to content

Studio: clarify tool permission controls - #7181

Merged
oobabooga merged 7 commits into
mainfrom
agent/clarify-permission-mode-controls
Jul 20, 2026
Merged

oobabooga merged 7 commits into
mainfrom
agent/clarify-permission-mode-controls

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Rename the user-facing permission control to Tool permissions.
  • Rename the old Off label to Run automatically without changing its stored value or backend behavior.
  • Keep the permission pill visible in every mode and make active-mode selection idempotent.
  • Remove nested interactive controls from menu items and share the Full access warning.
  • Keep compact pill layout aligned with the controls that are actually visible, including disabled RAG state.
  • Add focused permission E2E coverage and cross-browser CI jobs.
  • Keep the browser helper compatible with macOS Bash 3.2 when no frontend override is set.

Behavior

  • Ask for approval continues to use ask.
  • Approve for me continues to use auto.
  • Run automatically continues to use off.
  • Full access remains session-only and still requires explicit confirmation.
  • Legacy confirm_tool_calls values continue to migrate to the same modes.
  • Request payloads and backend permission semantics are unchanged.

Browser coverage

The focused permission flow now covers:

  • fresh defaults and legacy setting migration
  • all labels and stored values
  • keyboard dismissal and focus restoration
  • active-mode no-op behavior
  • compact viewport clipping
  • Full access cancel, confirmation, danger styling, and reload behavior
  • nested interactive element prevention

CI runs the existing full Chromium flow and adds focused coverage for Firefox, WebKit, installed Chrome, and installed Edge on the available operating-system runners.

Validation

  • npm run typecheck
  • npm run i18n:check
  • npm run build
  • Focused permission E2E passed in bundled Chromium
  • Focused permission E2E passed in bundled Firefox
  • Focused permission E2E passed in bundled WebKit
  • Focused permission E2E passed in installed Chrome
  • The browser helper script passed end to end against a fresh isolated Studio home
  • Bash 3.2 simulation passed with no frontend override and with a space-containing override path
  • Shell validation passed for the helper script
  • Workflow YAML and modified-workflow action validation passed
  • Repository pre-commit hooks passed

@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 👍 / 👎.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex

@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: 7e6eacf322

ℹ️ 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".

(permissionPillVisible ? 1 : 0) +
4 +
(showImagePill ? 1 : 0) +
(showRagPill && ragEnabled && !ragDisabled ? 1 : 0) +

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 Count disabled RAG pills before compacting

When RAG has been enabled and then becomes disabled (for example after loading a local model without tool support), KnowledgeBaseComposerButton still renders the dimmed RAG pill so the user can turn it off. This expression stops counting that visible pill, so in compare mode Compare + permissions + Search + Code + disabled RAG is five visible pills while pillsCompact stays false, leaving full labels in a row that should switch to the compact layout; the normal composer has the same undercount when another optional pill is visible.

Useful? React with 👍 / 👎.

Comment on lines +278 to 280
<span className="composer-pill-glyph">
<ActiveIcon className="size-[15px]" strokeWidth={2} />
<XIcon className="composer-pill-x" />
</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Avoid hiding the Full access icon on hover

When Full access is selected, the button still has data-active="true", which matches the existing CSS rule that hides .composer-pill-glyph > :not(.composer-pill-x) on hover and expects the X icon to appear. Since this change removes the .composer-pill-x from the permission pill, hovering the Full access pill leaves an empty glyph slot and the danger indicator disappears.

Useful? React with 👍 / 👎.

Comment on lines +278 to 281
<span className="composer-pill-glyph">
<ActiveIcon className="size-[15px]" strokeWidth={2} />
<XIcon className="composer-pill-x" />
</span>
<span>{active.label}</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Keep the main composer expanded in off mode

Now that this pill renders even for the off/Run automatically mode, the main composer still computes composerExpanded with permissionMode !== "off"; with no other active tool, selecting Run automatically leaves this pill visible but keeps Search and Code inside the non-rendered expanded branch. That contradicts the new always-visible permission control behavior and hides the primary tool toggles until the user reopens them through the plus menu or activates another tool.

Useful? React with 👍 / 👎.

# Conflicts:
#	.github/workflows/studio-mac-ui-smoke.yml
#	.github/workflows/studio-windows-ui-smoke.yml
#	studio/frontend/src/features/chat/permission-mode-select.tsx
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: bf8cd8fa5c

ℹ️ 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".

@oobabooga

Copy link
Copy Markdown
Member

I built current main and this branch merged with main, served each from an isolated Studio home, and ran the focused permission flow in bundled Chromium.

On main the flow fails at the permission step: the menu still shows the legacy Off entry and no Run automatically. On the merged branch it passes end to end, from the renamed labels and legacy setting migration through the Full access confirmation, with localStorage still storing off. The store and request payloads are untouched, so permission behavior is unchanged.

LGTM to merge @shimmyshimmer.

@oobabooga
oobabooga merged commit 2916e84 into main Jul 20, 2026
41 checks passed
@oobabooga
oobabooga deleted the agent/clarify-permission-mode-controls branch July 20, 2026 12:55
VectorCipher pushed a commit to VectorCipher/unsloth that referenced this pull request Jul 20, 2026
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.

2 participants