Loading...
Loading...
Use when Codex on macOS must drive the user's Chromium browser (Brave, Vivaldi, Opera, Edge, Chrome) through the bundled Chrome plugin, or that plugin fails with "Codex auth token is unavailable", a missing extension connection, or a stale plugin cache after a desktop app update. Codex only.
npx skill4agent add vivswan/skills codex-browser-fix| Symptom | Cause | Fix |
|---|---|---|
| | Preflight installs a launcher that overrides the provider for that one subprocess |
| Extension found yesterday, missing or erroring today | The desktop app updated; | Preflight re-syncs the cache and the trust hashes to the installed app |
| User asked for Brave (or Vivaldi, Opera) and the agent picked Chrome | The vendor skill only names | Select by |
skills/control-chrome/SKILL.mdCodex auth token is unavailablebrowser-client.mjs<skill-dir>~/.codex/skills/codex-browser-fixbun "<skill-dir>/scripts/browser-plugin-preflight.mts" # sync + verify
bun "<skill-dir>/scripts/browser-plugin-preflight.mts" --check # read-only verify, exit 1 on driftbrowser-client.mjsconfig.toml$CODEX_HOME~/.codex--plugin-dir <dir>--checkconfig.toml--plugin-dir<home><home>/plugins/cache/openai-bundled/chromelatest<home>/plugins/cache/openai-bundled/browserlatest<home>/plugin-rollbacks/<home>/config.toml[mcp_servers.node_repl.env]CODEX_CLI_PATH[shell_environment_policy.set]browser-client.mjs<home>/scripts/browser-codexapp-server-c 'model_provider="openai"'CODEX_HOME<home>/hosts/<host>/plugins/cache/openai-bundled/browserconfig.tomlscripts/browser-codexcontrol-chromenode_replbrowser-client.mjssetupBrowserRuntime()agentagent.browsers.get("chrome")agent.browsers.get("edge")// Declared once per session; call it again with a profile name after asking.
async function selectExtension(family, profileName) {
const label = (c) => c.profileName ?? c.name; // the name shown when asking
const candidates = (await agent.browsers.list()).filter(
(c) =>
c.type === "extension" &&
c.family === family &&
(profileName === undefined || label(c) === profileName),
);
if (candidates.length === 0) throw new Error(`No connected ${family} extension`);
if (candidates.length > 1) {
const profiles = candidates.map(label).join(", ");
throw new Error(`Several ${family} profiles connected (${profiles}); ask which one`);
}
return agent.browsers.get(candidates[0].id);
}
let browser = await selectExtension("brave", undefined); // or ("brave", "Work") once known
nodeRepl.write(await browser.documentation());selectExtensionbrowserscripts/extension-ids.jsonbravechromeedgeoperavivaldidocumentation()browser.user.openTabs()Codex auth token is unavailableawait agent.documentation.get("bootstrap-troubleshooting")await agent.documentation.get("chrome-troubleshooting")model_provider--checkreferences/recovery.mdscripts/browser-plugin-preflight.mts--checkscripts/browser-auth-launcher.mtsconfig.toml