feat(extension): add opt-out flag to disable automation tab grouping#1463
Open
keen0206 wants to merge 1 commit into
Open
feat(extension): add opt-out flag to disable automation tab grouping#1463keen0206 wants to merge 1 commit into
keen0206 wants to merge 1 commit into
Conversation
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.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
chrome.storage.localboolean (opencli_disable_automation_tab_group) that, when set totrue, 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, orchrome.tabs.ungroupall 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:DISABLE_TAB_GROUP_KEY = 'opencli_disable_automation_tab_group'isAutomationTabGroupDisabled()readingchrome.storage.localensureOwnedContainerTabGroupwhen the flag is setextension/src/background.test.ts: new test covering the opt-out path (asserts neitherchrome.tabs.groupnorchrome.tabGroups.updateis 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 consoleextension/dist/background.js: rebuilt vianpm run buildHow tabs stay tracked without grouping
The extension already tracks owned tabs by id via the
automationSessionsmap plus persisted state inchrome.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 skipschrome.tabs.group+chrome.tabGroups.update; everything else is unchanged.Test plan
cd extension && npx tsc --noEmit— passesnpx tsc --noEmit(repo root) — passesnpx vitest run extension/src/background.test.ts— 51/51 pass (50 existing + 1 new)cd extension && npm run build— produces updateddist/background.js