Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(account-switcher): remove obsolete native probe
  • Loading branch information
Adiker committed Nov 22, 2026
commit 8fc6578f9ae62abd42eacfc7b7b60101942b342f
15 changes: 0 additions & 15 deletions linux-features/account-switcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,6 @@ mkdir -p "$test_tmp"
TMPDIR="$test_tmp" node --test linux-features/account-switcher/test.js
```

Set `CODEX_ACCOUNT_SWITCHER_NATIVE_APP` to an extracted official application
root and `CODEX_ACCOUNT_SWITCHER_ASAR_CLI` to `@electron/asar/bin/asar.mjs` to also
run the native Owl regression test. This requires a graphical session and an
unlocked Secret Service provider. It generates a disposable probe, uses synthetic
credentials, verifies key persistence and vault decryption in fresh switcher
instances, and exercises **Add account** with the official connection class's
request/subscription methods. An initially disconnected hosted connection must
remain untouched, and the probe rejects any attempts to query global cloud work.
The probe uses a synthetic transport and intercepts the browser launch, then
cancels OAuth; it does not log in to real accounts. It exits only its own process
and clears only its own test key.
Do not set a long build `TMPDIR` when launching a desktop app: Chromium's socket
path must fit the Unix-domain socket limit. Use `TMPDIR="$XDG_RUNTIME_DIR"` for
interactive launches instead.

Set `CODEX_ACCOUNT_SWITCHER_CLI` to the extracted official `resources/codex` to
also check credential-file decoding and the idle-check protocol in a disposable,
unauthenticated app server. This does not test OAuth with real accounts.
Expand Down
87 changes: 0 additions & 87 deletions linux-features/account-switcher/native-probe.js

This file was deleted.

37 changes: 0 additions & 37 deletions linux-features/account-switcher/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,40 +667,3 @@ test("official main and profile dropdown chunks patch uniquely and remain valid
}
}
});

test("official Owl reaches OAuth and reopens an encrypted vault without querying independent cloud work", {
skip: !process.env.CODEX_ACCOUNT_SWITCHER_NATIVE_APP || !process.env.CODEX_ACCOUNT_SWITCHER_ASAR_CLI,
timeout: 30_000,
}, t => {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "account-native-"));
const app = process.env.CODEX_ACCOUNT_SWITCHER_NATIVE_APP;
const home = path.join(dir, "home"), profile = path.join(dir, "profile");
const probe = path.join(dir, "app"), source = path.join(dir, "source");
fs.mkdirSync(path.join(probe, "resources"), { recursive: true });
fs.mkdirSync(source);
t.after(() => {
if (fs.existsSync(home)) {
const id = crypto.createHash("sha256").update(fs.realpathSync(home)).digest("hex");
try { execFileSync("secret-tool", ["clear", "application", "codex-desktop", "feature", "account-switcher", "profile", id], { stdio: "ignore", timeout: 5_000 }); } catch {}
}
fs.rmSync(dir, { recursive: true, force: true });
});
fs.copyFileSync(path.join(app, "ChatGPT"), path.join(probe, "ChatGPT"));
fs.chmodSync(path.join(probe, "ChatGPT"), 0o755);
for (const name of fs.readdirSync(app)) {
if (["ChatGPT", "resources", "start.sh", ".codex-linux"].includes(name)) continue;
fs.symlinkSync(path.join(app, name), path.join(probe, name));
}
for (const name of ["owl-app.ini", "owl-electron-app.json"]) fs.copyFileSync(path.join(app, "resources", name), path.join(probe, "resources", name));
fs.copyFileSync(path.join(__dirname, "native-probe.js"), path.join(source, "probe.js"));
fs.writeFileSync(path.join(source, "package.json"), JSON.stringify({ name: "account-native-probe", version: "1.0.0", main: "probe.js" }));
execFileSync(process.execPath, [process.env.CODEX_ACCOUNT_SWITCHER_ASAR_CLI, "pack", source, path.join(probe, "resources/app.asar")], { stdio: "pipe", timeout: 5_000 });
const result = path.join(dir, "result.json");
execFileSync(path.join(probe, "ChatGPT"), [`--user-data-dir=${profile}`], {
env: { ...process.env, TMPDIR: process.env.XDG_RUNTIME_DIR || "/tmp", CODEX_HOME: home, CODEX_ELECTRON_USER_DATA_PATH: profile,
ACCOUNT_SWITCHER_PROBE_RUNTIME: process.env.CODEX_ACCOUNT_SWITCHER_PROBE_RUNTIME || path.join(__dirname, "runtime.js"), ACCOUNT_SWITCHER_PROBE_RESULT: result,
ACCOUNT_SWITCHER_PROBE_NATIVE_APP: app },
stdio: "pipe", timeout: 20_000,
});
assert.deepEqual(JSON.parse(fs.readFileSync(result)), { menus: 3, encryptedVault: true, errors: [], openedLogin: 1, readyChecks: 4, cloudUntouched: true });
});