Skip to content

feat(extension): add opt-out flag to disable automation tab grouping#1463

Open
keen0206 wants to merge 1 commit into
jackwener:mainfrom
keen0206:feat/opt-out-automation-tab-group
Open

feat(extension): add opt-out flag to disable automation tab grouping#1463
keen0206 wants to merge 1 commit into
jackwener:mainfrom
keen0206:feat/opt-out-automation-tab-group

Conversation

@keen0206
Copy link
Copy Markdown

Summary

Adds a chrome.storage.local boolean (opencli_disable_automation_tab_group) that, when set to true, makes the extension skip grouping owned tabs into a named tab group (OpenCLI Browser / OpenCLI Adapter). Default behavior is unchanged.

Motivation

Chrome 119+ ships a "Saved Tab Groups" feature that auto-saves any named/colored tab group to the user's sidebar and keeps it there even after the underlying window is closed. For workflows that repeatedly spin up short-lived owned windows (e.g. periodic adapter calls from a scheduled job), entries accumulate in the saved-groups list with no API surface to remove them — chrome.tabGroups.* doesn't expose deletion of saved entries, and the three related Chrome flags (tab group sync / tab groups save / saved tab groups) have all been removed.

Closing tabs / windows / ungrouping via chrome.tabs.remove, chrome.windows.remove, or chrome.tabs.ungroup all leave the saved entry behind. The only effective mitigation is never to name/color the group in the first place.

Rather than remove the existing grouping behavior — which other users explicitly requested (see #1043) for visual organisation — this PR adds an opt-out flag so users running automation-heavy workflows can suppress it without affecting anyone else.

What changes

  • extension/src/background.ts:
    • New constant DISABLE_TAB_GROUP_KEY = 'opencli_disable_automation_tab_group'
    • New helper isAutomationTabGroupDisabled() reading chrome.storage.local
    • Early-return added to ensureOwnedContainerTabGroup when the flag is set
  • extension/src/background.test.ts: new test covering the opt-out path (asserts neither chrome.tabs.group nor chrome.tabGroups.update is called when the flag is set; tab id is still resolvable)
  • extension/README.md: new "Configuration" section documenting the flag, the rationale (Chrome 119+ saved tab groups), and how to enable/revert from the service worker DevTools console
  • extension/dist/background.js: rebuilt via npm run build

How tabs stay tracked without grouping

The extension already tracks owned tabs by id via the automationSessions map plus persisted state in chrome.storage.local[REGISTRY_KEY]. The tab group is purely a visual marker — disabling it does not affect adapter functionality, lease lifecycle, or tab reuse logic. The flag only skips chrome.tabs.group + chrome.tabGroups.update; everything else is unchanged.

Test plan

  • cd extension && npx tsc --noEmit — passes
  • npx tsc --noEmit (repo root) — passes
  • npx vitest run extension/src/background.test.ts — 51/51 pass (50 existing + 1 new)
  • cd extension && npm run build — produces updated dist/background.js
  • Manual smoke: load patched extension, set the flag, run an adapter command, confirm no new entry appears in Chrome's saved tab groups sidebar

Chrome 119+ ships a "Saved Tab Groups" feature that auto-saves any named/
colored tab group to the user's sidebar and keeps it there even after the
underlying window is closed. For automation-heavy workflows that spin up
many short-lived owned windows, this causes `OpenCLI Adapter` (or
`OpenCLI Browser`) entries to accumulate in the saved-groups list, and
neither the extension nor `chrome.tabGroups.*` exposes an API to remove
them.

This change adds a chrome.storage.local boolean
`opencli_disable_automation_tab_group`. When set to `true`,
`ensureOwnedContainerTabGroup` is a no-op — tabs are tracked entirely by
id via the existing automationSessions map, so adapters keep working;
only the visual grouping is suppressed.

The default behavior is unchanged. Existing users see no difference.
Users affected by saved-group accumulation can opt out from the
extension's service worker DevTools console:

  chrome.storage.local.set({ opencli_disable_automation_tab_group: true })

Includes a unit test covering the opt-out path and documentation in
extension/README.md.
@GreyC
Copy link
Copy Markdown
Contributor

GreyC commented May 13, 2026

Related follow-up issue: #1535. #1463 adds an opt-out for automation tab grouping; #1535 is narrower and keeps grouping enabled but reuses an existing OpenCLI Adapter/legacy OpenCLI group before creating a duplicate.

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