Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save malipetek/1a634002fc8f066feb45acc264d14052 to your computer and use it in GitHub Desktop.

Select an option

Save malipetek/1a634002fc8f066feb45acc264d14052 to your computer and use it in GitHub Desktop.
If your codex agent is having "Grouping is not supported by tabs in this window." error, apply these fixes.

Chrome Profile Recovery Fix

Use this when the Codex Chrome Extension can list the user's real Chrome tabs with browser.user.openTabs(), but browser.user.claimTab(...) fails with:

Grouping is not supported by tabs in this window.

This is a Chrome control-plane issue, not a login issue. The extension can see the user's profile, but cannot take over the grouped or unsupported window. The reliable recovery is to create a fresh, profile-scoped blank Chrome tab, claim that new tab, and navigate it to the authenticated target site.

Agent Task

Patch the Chrome plugin, not the site-specific automation.

Files to edit inside the Chrome plugin:

<chrome-plugin-root>/scripts/open-chrome-window.js
<chrome-plugin-root>/skills/chrome/SKILL.md

Launcher Patch

Update scripts/open-chrome-window.js so it supports:

CODEX_CHROME_PROFILE_DIRECTORY
CODEX_CHROME_LAUNCH_FLAGS

Required behavior:

  1. If CODEX_CHROME_PROFILE_DIRECTORY is set, verify that <Chrome user data dir>/<profile>/Preferences exists and use that profile.
  2. On macOS, prefer launching Chrome via the app binary:
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  1. Do not use open -n for recovery. It can create a window/profile state the extension still cannot claim.
  2. Open a fresh about:blank tab with:
--profile-directory=<profile>
--new-window
about:blank
  1. Insert any CODEX_CHROME_LAUNCH_FLAGS before the URL, for example:
--profile-directory=Default --new-window --disable-features=TabGroups about:blank
  1. If direct binary launch fails on macOS, fall back to:
open -a "<Chrome app path>" --args ...

Skill Patch

Update skills/chrome/SKILL.md so agents follow this recovery sequence:

  1. Use agent.browsers.list() and choose the extension target matching the real user profile.
  2. Call browser.user.openTabs() first.
  3. Try to claim the relevant existing tab.
  4. If claim fails with grouping, try up to 3 already-open neutral tabs from the same openTabs() result.
  5. If those fail and recovery is authorized, run scripts/open-chrome-window.js for the selected profile.
  6. Re-bootstrap Chrome, call openTabs() again, choose the newest helper-created about:blank or New Tab, claim it, then navigate that claimed tab to the authenticated URL.
  7. Only after that fails should the agent report a grouped-window blocker or ask the user to open a disposable ungrouped tab.

Validation

Run:

CODEX_CHROME_PROFILE_DIRECTORY=Default \
node <chrome-plugin-root>/scripts/open-chrome-window.js --dry-run --json

Expected shape:

{
  "profileDirectory": "Default",
  "command": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
  "args": [
    "--profile-directory=Default",
    "--new-window",
    "about:blank"
  ]
}

Then run the real helper:

CODEX_CHROME_PROFILE_DIRECTORY=Default \
node <chrome-plugin-root>/scripts/open-chrome-window.js

After Chrome opens the fresh tab, use the Chrome skill runtime:

const tabs = await browser.user.openTabs();
const neutral = tabs.find(t => t.url === "about:blank" || t.url === "chrome://newtab/");
const tab = await browser.user.claimTab(neutral);
await tab.goto("https://www.linkedin.com/feed/");

If the fresh blank tab claims and navigates successfully, the fix works.

Optional Grouping Flag

If the newly opened blank tab is still affected by grouped-window state, launch with:

CODEX_CHROME_PROFILE_DIRECTORY=Default \
CODEX_CHROME_LAUNCH_FLAGS="--disable-features=TabGroups" \
node <chrome-plugin-root>/scripts/open-chrome-window.js

Do not switch to the Codex in-app browser for authenticated tasks. It does not have the user's Chrome cookies or logged-in profile context.

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