@jbkjr/relay 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -73,7 +73,9 @@ review of the run as it goes. From a Codex session the same tools reach Claude,
73
73
  failure (a warning with that opt-in). Relay runs Claude under the login Claude Code has stored,
74
74
  and Codex under the login in relay's own Codex home (see [Codex](#codex)). `relay doctor` prints
75
75
  the method each CLI reports (`claude auth status`, `codex login status`); for Codex that can be a
76
- ChatGPT account or a stored API key.
76
+ ChatGPT account or a stored API key. For Codex it also asks Codex's app server which account it
77
+ is signed in with, the check each turn makes, since `codex login status` only finds a stored
78
+ login, and Codex may no longer accept it (one that expired and could not be refreshed).
77
79
  - Launched agents use your Claude and ChatGPT plans like any other use of those CLIs. See
78
80
  [Accounts and cost](#accounts-and-cost).
79
81
 
@@ -93,6 +95,10 @@ Then sign Codex in once for relay, which runs Codex with a Codex home of its own
93
95
  CODEX_HOME="$HOME/.local/share/relay-codex-home" ~/.local/share/relay-codex-pins/current/bin/codex login
94
96
  ```
95
97
 
98
+ On a remote or headless Mac, add `--device-auth`, which needs device code sign-in switched on in
99
+ ChatGPT's Security settings. The same command signs in again when relay says Codex no longer
100
+ accepts the stored login.
101
+
96
102
  Restart your Claude Code and Codex sessions: each session starts its own relay server when it
97
103
  starts.
98
104
 
@@ -185,7 +191,8 @@ Relay runs the pinned Codex with a Codex home of its own, `~/.local/share/relay-
185
191
  `~/.codex`, which is why it needs the one-time `codex login` above (`relay install codex --write`
186
192
  makes that home, with the `config.toml` relay rewrites on every turn). `relay doctor` shows under
187
193
  "codex pin" which pin is in force (shipped or local) and for which Codex, under "codex home" and
188
- "codex login" whether that home is signed in, and under "codex launch" whether a Codex job started
194
+ "codex login" whether that home is signed in (by the account Codex's app server reports, as each
195
+ turn checks, not only by `codex login status`), and under "codex launch" whether a Codex job started
189
196
  in the current directory passes the check each turn makes of Codex's effective configuration
190
197
  (system, managed and project layers included). Your own `~/.codex` is for your own Codex sessions:
191
198
  relay's jobs read none of it ("your codex").
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "relay",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Reach coding agents of other families (Codex from Claude Code, Claude from Codex) through the relay MCP server: delegate, consult, discuss, review."
5
5
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relay",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Reach coding agents of other families (Codex from Claude Code, Claude from Codex) through the relay MCP server: delegate, consult, discuss, review.",
5
5
  "skills": "./skills/"
6
6
  }
package/codex-pin.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "relay": {
8
8
  "scheme": "relay-build-v2",
9
- "version": "1.2.1",
10
- "sha256": "ca2c9d565a2d7ea7865ac68da35549a3e8ccd9dbac586cc7d4e092f3cee4e94c"
9
+ "version": "1.2.2",
10
+ "sha256": "413ac1447e8118e69184e5efa819df744af56d38f2fabfdfd9546ff9e9fcd219"
11
11
  }
12
12
  }
@@ -12,6 +12,7 @@ import { diagnosticTail } from "../core/redact.js";
12
12
  import { speedRank } from "../targets/index.js";
13
13
  import { skipDaybreak } from "./codex-daybreak.js";
14
14
  import { codexShellPolicyNote } from "./codex-shell-policy.js";
15
+ import { codexLoginStored, STORED_LOGIN_REJECTED } from "./codex-pin.js";
15
16
  import { CodexSubagents } from "./codex-subagents.js";
16
17
  import { stage2BrokerConfigProblem } from "./codex-stage2.js";
17
18
  import { BROKER_SERVER_NAME } from "../confine/broker-names.js";
@@ -293,7 +294,11 @@ async function loginProblem(rpc, expect) {
293
294
  }
294
295
  if (type === "chatgpt")
295
296
  return null;
296
- return `Codex is ${type ? `signed in with ${type === "apiKey" ? "an API key" : String(type)}` : "not signed in"}, not with a ChatGPT account, and relay is set not to run on API keys ("child_auth": "any" allows it)`;
297
+ const how = expect.signIn;
298
+ // No account, though relay's Codex home holds a login: one Codex no longer accepts.
299
+ if (!type && how && codexLoginStored(how.home))
300
+ return `Codex is not signed in: relay's Codex home ${how.home} holds a login, but ${STORED_LOGIN_REJECTED}. ${how.again}`;
301
+ return `Codex is ${type ? `signed in with ${type === "apiKey" ? "an API key" : String(type)}` : "not signed in"}, not with a ChatGPT account, and relay is set not to run on API keys ("child_auth": "any" allows it)${how ? `. ${how.once}` : ""}`;
297
302
  }
298
303
  /** Codex's own default for chatgpt_base_url (codex-rs core config): leaving it so redirects nothing. */
299
304
  const CHATGPT_BASE_URL = "https://chatgpt.com/backend-api/";
@@ -1013,6 +1018,15 @@ export async function codexPreflight(o) {
1013
1018
  try {
1014
1019
  await rpc.request("initialize", HELLO);
1015
1020
  rpc.send({ method: "initialized" });
1021
+ if (o.onAccount) {
1022
+ let account;
1023
+ try {
1024
+ account = (await rpc.request("account/read", { refreshToken: false }))?.account;
1025
+ }
1026
+ catch { /* unknown: loginProblem says so, where a turn checks it */ }
1027
+ if (account !== undefined)
1028
+ o.onAccount(account && typeof account.type === "string" ? account.type : null);
1029
+ }
1016
1030
  const read = await rpc.request("config/read", { cwd: o.cwd, includeLayers: true });
1017
1031
  const eff = read.config;
1018
1032
  const problem = configProblem(eff, o.expect) ?? (await requirementsProblem(rpc, o.expect.permissions)) ?? (await loginProblem(rpc, o.expect)) ?? fastModeProblem(eff, o.expect)
@@ -300,6 +300,31 @@ export function codexLoginCommand(cfg) {
300
300
  const bin = cfg.targets.codex.pinned === false ? cfg.targets.codex.bin : path.join(relayCodexPinStore(cfg), "current", "bin", "codex");
301
301
  return `CODEX_HOME=${JSON.stringify(relayCodexHome(cfg))} ${JSON.stringify(bin)} login`;
302
302
  }
303
+ /** Where relay's Codex home cannot open a browser (a remote or headless Mac), Codex signs in with a device code instead. */
304
+ export const DEVICE_AUTH_NOTE = "on a remote or headless Mac, add --device-auth, which needs device code sign-in switched on in ChatGPT's Security settings";
305
+ /** How to sign relay's Codex home in (`again`: a login is stored there that Codex no longer accepts). */
306
+ export function codexSignIn(cfg, again = false) {
307
+ return `${again ? "Sign in again" : "Sign in once"} with ${codexLoginCommand(cfg)} (${DEVICE_AUTH_NOTE})`;
308
+ }
309
+ /**
310
+ * Whether relay's Codex home holds a stored login: auth.json is there, as a regular file. Metadata
311
+ * only, like codexHomeStatus: the file is never opened.
312
+ */
313
+ export function codexLoginStored(home) {
314
+ try {
315
+ return fs.lstatSync(path.join(home, "auth.json")).isFile();
316
+ }
317
+ catch {
318
+ return false;
319
+ }
320
+ }
321
+ /**
322
+ * Codex reports no account (account/read) though relay's Codex home holds a login: the stored login
323
+ * is one Codex no longer accepts. Seen on 2026-11-18 with an access token that had expired and a
324
+ * refresh token that had been revoked: Codex tries the refresh when its app server starts, and when
325
+ * that fails it reports no account. (An expired token whose refresh still works recovers by itself.)
326
+ */
327
+ export const STORED_LOGIN_REJECTED = "Codex no longer accepts it, most likely because it expired and Codex could not refresh it (its refresh token revoked, for one)";
303
328
  /**
304
329
  * Metadata only: never open or parse the credential file. Symlinks are not private credentials.
305
330
  * `problem`: why relay will not use this home (codexHomeProblem); doctor reports it and changes nothing.
@@ -1,6 +1,6 @@
1
1
  import { openaiRefusal } from "../core/refusal.js";
2
2
  import { assertNeverAdapter } from "./never-admission.js";
3
- import { freezeCodexConfig, prepareCodexHome } from "./codex-pin.js";
3
+ import { codexSignIn, freezeCodexConfig, prepareCodexHome } from "./codex-pin.js";
4
4
  import { relayCodexProtected } from "../core/protected-config.js";
5
5
  import { neverGrantProblem, neverProfileInputs, resolveNeverPolicy } from "../core/never-policy.js";
6
6
  import fs from "node:fs";
@@ -8,7 +8,7 @@ import os from "node:os";
8
8
  import path from "node:path";
9
9
  import { nativeTemp } from "./native-temp.js";
10
10
  import { codexVersion, daybreakCatalog, daybreakDecision, skipDaybreak } from "./codex-daybreak.js";
11
- import { authFor, canonical, RELAY_CLI } from "../core/config.js";
11
+ import { authFor, canonical, RELAY_CLI, relayCodexHome } from "../core/config.js";
12
12
  import { spawnFound } from "../core/executables.js";
13
13
  import { codexSkillFiles } from "../core/extensions.js";
14
14
  import { targetDef } from "../targets/index.js";
@@ -239,6 +239,8 @@ export const codexBackend = {
239
239
  * - `note`: what Codex's shell_environment_policy does with the names relay releases, when the turn would say so.
240
240
  * - `released`: those names.
241
241
  * - `stage2`: the job would run under stage 2 instead, which this does not judge (doctor's "codex stage 2" line does).
242
+ * - `account`: how the app server says relay's Codex home is signed in (account/read's account type,
243
+ * null for no account), read before any check; absent when it was not asked or did not say.
242
244
  */
243
245
  export async function codexLaunchCheck(cfg, cwd, access) {
244
246
  const none = { problem: null, unchecked: null, note: null, released: [], stage2: false };
@@ -278,11 +280,12 @@ export async function codexLaunchCheck(cfg, cwd, access) {
278
280
  return { ...none, problem: err.message };
279
281
  }
280
282
  let note = null;
283
+ let account;
281
284
  const problem = await codexPreflight({
282
285
  bin: t.bin, args: ["app-server", ...flags.off, ...flags.c], cwd, env: prepared.env, expect: flags.expect, model: spec.model,
283
- released: flags.released, onShellPolicyNote: (n) => (note = n),
286
+ released: flags.released, onShellPolicyNote: (n) => (note = n), onAccount: (type) => (account = type),
284
287
  });
285
- return { ...none, problem: problem?.trim() ?? null, note, released: flags.released };
288
+ return { ...none, problem: problem?.trim() ?? null, note, released: flags.released, ...(account !== undefined ? { account } : {}) };
286
289
  }
287
290
  finally {
288
291
  fs.rmSync(tmp, { recursive: true, force: true });
@@ -509,6 +512,7 @@ export function codexFlags(spec, servers, env, released = [], net, stage2, serve
509
512
  ...(stage2?.broker ? { broker: stage2.broker } : {}),
510
513
  ...(webOff ? { webSearch: "disabled" } : {}),
511
514
  accountLogin: authFor(cfg, "codex") === "login",
515
+ signIn: { home: relayCodexHome(cfg), once: codexSignIn(cfg), again: codexSignIn(cfg, true) },
512
516
  ...(spec.model ? { model: spec.model } : {}),
513
517
  ...(cfg.codex_endpoint_override === "accept" ? { endpointOverride: true } : {}),
514
518
  skills: { root: spec.skills ? path.join(spec.skills.dir, "skills") : null, names: spec.skills?.names ?? [] },
@@ -1,5 +1,5 @@
1
1
  {
2
- "commit": "04f30021b387413b841746753507dd3293dbc659",
2
+ "commit": "9168bf79e626bd9435eb4ece97efcc3a5eb9a7fe",
3
3
  "dirty": false,
4
- "built_at": "2026-11-19T05:53:31.756Z"
4
+ "built_at": "2026-11-19T18:40:13.473Z"
5
5
  }
@@ -12,8 +12,8 @@ import { otherFamilies, otherTargets, TARGETS, targetDef } from "../targets/inde
12
12
  import { briefSkill } from "./types.js";
13
13
  import { hostWaitCapS } from "../mcp/host.js";
14
14
  import { CODEX_MCP_ENV_VARS, codexToolTimeoutS } from "../targets/codex.js";
15
- import { DEFAULT_CONFIG, relayCodexHome } from "../core/config.js";
16
- import { codexHomeProblem, codexLoginCommand } from "../backends/codex-pin.js";
15
+ import { authFor, DEFAULT_CONFIG, relayCodexHome } from "../core/config.js";
16
+ import { codexHomeProblem, codexLoginCommand, codexLoginStored, codexSignIn, DEVICE_AUTH_NOTE, STORED_LOGIN_REJECTED } from "../backends/codex-pin.js";
17
17
  /** A plugin skill as Codex names it: $relay-delegate. */
18
18
  const skillRef = (skill) => `$relay-${skill}`;
19
19
  /** Codex's plugin: skills are invoked as $relay-<name>, plus a snippet for AGENTS.md. */
@@ -248,25 +248,41 @@ export const codexHost = {
248
248
  // The command is the CLI's own, documented under `codex login`. It reads stored credentials and
249
249
  // makes no model request. Relay prints only the method: no account, no key. Asked of relay's Codex
250
250
  // home, the login relay's Codex jobs run under (since 1.1.0), not of ~/.codex, which is the
251
- // person's own Codex sessions' and is not read by relay's jobs.
252
- doctorLogin(cfg, { line, warn, fail }) {
251
+ // person's own Codex sessions' and is not read by relay's jobs. `codex login status` only finds a
252
+ // stored login, which may be one Codex no longer accepts, so where the codex launch
253
+ // check's app server said how it is signed in (account/read, the check each turn makes), that
254
+ // decides the line, as it decides a turn.
255
+ doctorLogin(cfg, { line, warn, fail }, launch) {
253
256
  const home = relayCodexHome(cfg);
254
257
  // A home that is not relay's is reported on the codex home line; its login is not relay's either.
255
258
  if (codexHomeProblem(cfg))
256
259
  return line("codex login", `not checked: relay will not use ${home} as its Codex home (see the codex home line)`);
257
- const signIn = fs.existsSync(home) ? codexLoginCommand(cfg) : `relay install codex --write (which makes it), then ${codexLoginCommand(cfg)}`;
258
260
  // Codex refuses a CODEX_HOME that does not exist, with a message that names no login.
259
261
  if (!fs.existsSync(home))
260
- return fail("codex login", `relay's Codex home ${home} does not exist yet, so relay's Codex jobs have no login. Run ${signIn}`);
262
+ return fail("codex login", `relay's Codex home ${home} does not exist yet, so relay's Codex jobs have no login. Run relay install codex --write (which makes it), then ${codexLoginCommand(cfg)} (${DEVICE_AUTH_NOTE})`);
261
263
  const r = spawnFound(cfg.targets.codex.bin, ["login", "status"], { encoding: "utf8", env: { ...process.env, CODEX_HOME: home } });
262
264
  // Kept to the method: a key login is printed by Codex with part of the key.
263
265
  const said = first(`${r.stdout ?? ""}${r.stderr ?? ""}`).replace(/\s+-\s+.*$/, "").replace(/\bsk-\S+/g, "sk-…");
264
266
  if (/not logged in/i.test(said))
265
- fail("codex login", `relay's Codex home ${home} is not signed in, according to \`codex login status\` there. Sign in once with ${signIn}`);
266
- else if (!r.error && r.status === 0 && said)
267
- line("codex login", `${said}, in relay's Codex home ${home} (as \`codex login status\` reports it there)`);
267
+ return fail("codex login", `relay's Codex home ${home} is not signed in, according to \`codex login status\` there. ${codexSignIn(cfg)}`);
268
+ const stored = !r.error && r.status === 0 && said ? said : null;
269
+ // Judged only where a turn judges it: relay set not to run on API keys (child_auth "login").
270
+ const account = authFor(cfg, "codex") === "login" ? launch?.account : undefined;
271
+ const how = "according to the app server (account/read, the check each turn makes)";
272
+ if (account === null) {
273
+ const held = stored ? `holds a login (\`codex login status\`: ${stored})` : codexLoginStored(home) ? "holds a login" : null;
274
+ if (held)
275
+ return fail("codex login", `relay's Codex home ${home} ${held}, but Codex reports no account for it, ${how}, so relay refuses every Codex job: ${STORED_LOGIN_REJECTED}. ${codexSignIn(cfg, true)}`);
276
+ return fail("codex login", `relay's Codex home ${home} is not signed in, ${how}, so relay refuses every Codex job. ${codexSignIn(cfg)}`);
277
+ }
278
+ if (account !== undefined && account !== "chatgpt") {
279
+ return fail("codex login", `relay's Codex home ${home} is signed in with ${account === "apiKey" ? "an API key" : account}, ${how}, not with a ChatGPT account, and relay is set not to run on API keys ("child_auth": "any" allows it). ${codexSignIn(cfg)}`);
280
+ }
281
+ const checked = account === "chatgpt" ? "; the app server reports a ChatGPT account there, as each turn checks" : "";
282
+ if (stored)
283
+ line("codex login", `${stored}, in relay's Codex home ${home} (as \`codex login status\` reports it there)${checked}`);
268
284
  else
269
- warn("codex login", `\`codex login status\` did not say; relay cannot tell whether its Codex home ${home} is signed in (${signIn})`);
285
+ warn("codex login", `\`codex login status\` did not say; relay cannot tell whether its Codex home ${home} is signed in (${codexLoginCommand(cfg)})${checked}`);
270
286
  },
271
287
  doctorRegistration(cfg, present, { line, warn, registration }) {
272
288
  /** What doctor says of relay's registration, from Codex's own report or from its config.toml. */
@@ -182,6 +182,8 @@ async function doctorScoped() {
182
182
  }
183
183
  const codexConfigFile = () => path.join(relayCodexHome(cfg), "config.toml");
184
184
  let claudeVersion = null;
185
+ // How the codex launch check's app server said relay's Codex home is signed in, for the codex login line.
186
+ const codexLaunch = {};
185
187
  for (const t of TARGETS.filter((t) => cfg.targets[t.id].enabled)) {
186
188
  const cli = t.id;
187
189
  if (cli === "codex" && codexPinProblem)
@@ -329,8 +331,12 @@ async function doctorScoped() {
329
331
  if (held !== null && held !== RELAY_CODEX_CONFIG)
330
332
  line("codex home", `${codexConfigFile()} held changes of its own; relay replaces that file on every turn, so they never apply to a job, and the check below put relay's back first, as a turn does`);
331
333
  const checks = [];
332
- for (const access of ["read", "write"])
333
- checks.push({ access, ...(await codexLaunchCheck(cfg, cwd, access)) });
334
+ for (const access of ["read", "write"]) {
335
+ const { account, ...check } = await codexLaunchCheck(cfg, cwd, access);
336
+ checks.push({ access, ...check });
337
+ if (account !== undefined && codexLaunch.account === undefined)
338
+ codexLaunch.account = account;
339
+ }
334
340
  const unchecked = checks.find((c) => c.unchecked);
335
341
  const judged = checks.filter((c) => !c.stage2 && !c.unchecked);
336
342
  const refused = judged.filter((c) => c.problem);
@@ -450,7 +456,7 @@ async function doctorScoped() {
450
456
  // Each CLI's own login command. Relay runs each CLI under whatever login it reports here.
451
457
  for (const h of HOSTS)
452
458
  if (h.doctorLogin && present[h.target])
453
- h.doctorLogin(cfg, report);
459
+ h.doctorLogin(cfg, report, h.target === "codex" ? codexLaunch : undefined);
454
460
  const bin = path.dirname(linkPath());
455
461
  const found = locate("relay");
456
462
  // Which `relay` a shell runs: this relay's launcher (the link install makes) or npm's global
package/docs/UPGRADING.md CHANGED
@@ -106,6 +106,22 @@ What restoring loses: the registry's record of whatever ran under the newer rele
106
106
  Newest first. Relay 1.1.4 and earlier came before the first public release; their notes are kept
107
107
  because later notes and the reference docs point into them.
108
108
 
109
+ ## Relay 1.2.2
110
+
111
+ A fix release. No config or registry migration is needed, and Codex pins in your store keep working.
112
+
113
+ - **`relay doctor`'s "codex login" line goes by the account Codex reports**, the check each Codex
114
+ turn makes (`account/read`), not only by `codex login status`, which finds a stored login whether
115
+ or not Codex still accepts it. A login stored in relay's Codex home that Codex no longer accepts
116
+ (most likely one that expired and could not be refreshed) now fails the line, where before the
117
+ line said "Logged in" while every Codex job was refused. Under the default `child_auth`, an API-key
118
+ login there fails the line too, as it already failed each turn. Doctor asks the app server it
119
+ already starts for the "codex launch" line, so it starts nothing more.
120
+ - **A Codex turn refused for its login says how to sign in again**: the `codex login` command for
121
+ relay's Codex home and pin, with `--device-auth` for a remote or headless Mac (which needs device
122
+ code sign-in switched on in ChatGPT's Security settings). When a login is stored but Codex no
123
+ longer accepts it, the refusal says so, rather than only "not signed in".
124
+
109
125
  ## Relay 1.2.1
110
126
 
111
127
  The first public release (1.2.0 was tagged in the pre-publication repository and never published,
@@ -87,6 +87,18 @@ not exist, and relay's file keeps the login in the file store its turns read):
87
87
  CODEX_HOME="$HOME/.local/share/relay-codex-home" ~/.local/share/relay-codex-pins/current/bin/codex login
88
88
  ```
89
89
 
90
+ On a remote or headless Mac, add `--device-auth`, which needs device code sign-in switched on in
91
+ ChatGPT's Security settings.
92
+
93
+ `relay doctor`'s "codex login" line goes by the account Codex's app server reports for that home
94
+ (`account/read`), the check each turn makes before it starts, and not only by `codex login status`,
95
+ which finds a stored login whether or not Codex still accepts it. When a login is stored there but
96
+ Codex reports no account, the line fails and each Codex turn is refused, both saying that Codex no
97
+ longer accepts the stored login, most likely because it expired and Codex could not refresh it (on
98
+ 2026-11-18, a revoked refresh token), and giving the command above to sign in again. An expired
99
+ login whose refresh still works needs nothing: Codex refreshes it when its app server starts.
100
+ Under `child_auth: "any"` a turn does not check the login, and neither does the line.
101
+
90
102
  ## A release's shipped pin
91
103
 
92
104
  A release installed from npm carries `codex-pin.json`,
@@ -97,7 +109,7 @@ the maintainer's qualification of one Codex release with exactly that relay buil
97
109
  {
98
110
  "format": "relay-shipped-codex-pin-v1",
99
111
  "codex": { "version": "0.169.0", "npmIntegrity": "sha512-…" },
100
- "relay": { "scheme": "relay-build-v2", "version": "1.2.1", "sha256": "…" }
112
+ "relay": { "scheme": "relay-build-v2", "version": "1.2.2", "sha256": "…" }
101
113
  }
102
114
  ```
103
115
 
@@ -302,7 +314,7 @@ Failure text goes to `runs/.../runner.log`, `failure.json`, `last-failure.json`,
302
314
  CODEX_HOME="$HOME/.local/share/relay-codex-home" ~/.local/share/relay-codex-pins/current/bin/codex login
303
315
  ```
304
316
 
305
- If `targets.codex.home` is set to another path, use that. The scheduled qualification never uses this login: it runs Codex with scratch homes and its own fake model.
317
+ If `targets.codex.home` is set to another path, use that. On a remote or headless Mac, add `--device-auth`, which needs device code sign-in switched on in ChatGPT's Security settings. The scheduled qualification never uses this login: it runs Codex with scratch homes and its own fake model.
306
318
 
307
319
  5. **Install the agent, check notifications, and load it.** The installer prints the plist it would write; `--install` writes it, with the validated config and log directories and restrictive permissions, but does not load it:
308
320
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@jbkjr/relay",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@jbkjr/relay",
9
- "version": "1.2.1",
9
+ "version": "1.2.2",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@modelcontextprotocol/sdk": "1.32.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbkjr/relay",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Lets coding agents of different model families (Claude Code, OpenAI Codex CLI) call each other: delegate, consult, discuss and review across families, over one MCP server",
5
5
  "license": "MIT",
6
6
  "author": "Jack Koch",
@@ -130,7 +130,7 @@ test("stable surfaces: CLI usage, version aliases and misuse status", () => {
130
130
  for (const alias of ["--version", "-v", "version"]) {
131
131
  const r = spawnSync(process.execPath, [CLI, alias], { encoding: "utf8" });
132
132
  assert.equal(r.status, 0);
133
- assert.equal(r.stdout, "relay 1.2.1\n");
133
+ assert.equal(r.stdout, "relay 1.2.2\n");
134
134
  }
135
135
  const bad = spawnSync(process.execPath, [CLI, "unknown-command"], { encoding: "utf8" });
136
136
  assert.equal(bad.status, 2);
@@ -41,10 +41,10 @@ if (process.env.FAKE_FAIL && `${name} ${line}`.includes(process.env.FAKE_FAIL))
41
41
  if (name === "codex" && (args[0] === "app-server" || (args.includes("mcp") && args.includes("list")))) {
42
42
  const { spawnSync } = await import("node:child_process");
43
43
  // A test's stand-in for a configuration layer above relay's flags (codex-effective.json, codex-shell-policy.json)
44
- // or below them (codex-features.json, the person's own features), from files in FAKE_DIR: the turn's
44
+ // or below them (codex-features.json, the person's own features), and for the login (codex-account.txt), from files in FAKE_DIR: the turn's
45
45
  // environment, which this process has, carries no STUB_* name (relay's environment policy drops them).
46
46
  const overlay = (file, key) => (fs.existsSync(path.join(dir, file)) ? { [key]: fs.readFileSync(path.join(dir, file), "utf8") } : {});
47
- const env = { ...process.env, STUB_DIR: process.env.STUB_DIR ?? dir, ...overlay("codex-effective.json", "STUB_CODEX_EFFECTIVE"), ...overlay("codex-shell-policy.json", "STUB_CODEX_SHELL_POLICY"), ...overlay("codex-features.json", "STUB_CODEX_FEATURES") };
47
+ const env = { ...process.env, STUB_DIR: process.env.STUB_DIR ?? dir, ...overlay("codex-effective.json", "STUB_CODEX_EFFECTIVE"), ...overlay("codex-shell-policy.json", "STUB_CODEX_SHELL_POLICY"), ...overlay("codex-features.json", "STUB_CODEX_FEATURES"), ...overlay("codex-account.txt", "STUB_ACCOUNT") };
48
48
  const r = spawnSync(process.execPath, [new URL("./stub-codex", import.meta.url).pathname, ...args], { stdio: "inherit", env });
49
49
  process.exit(r.status ?? 1);
50
50
  }