@minhspark/codex-mcp-bridge 1.19.3 → 1.19.4
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/CHANGELOG.md +6 -0
- package/README.md +1 -0
- package/package.json +1 -1
- package/scripts/check.mjs +3 -0
- package/scripts/install-native-relay.mjs +1 -1
- package/src/app-server-client.mjs +24 -0
- package/src/claude-bridge.mjs +1 -1
- package/src/index.mjs +1 -1
- package/src/native-relay-companion.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [SemVer](ht
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [1.19.4] - 2026-10-02
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Detect a managed Codex `requirements.toml` whose `allowed_sandbox_modes` omits `read-only` before auto-starting an external app-server. The bridge and `npm run check` now report the policy error directly instead of waiting for a generic connection failure; they do not edit the administrator-managed file.
|
|
12
|
+
|
|
7
13
|
## [1.19.3] - 2026-09-30
|
|
8
14
|
|
|
9
15
|
### Changed
|
package/README.md
CHANGED
|
@@ -310,6 +310,7 @@ Start with `codex doctor` for Codex installation problems and `claude doctor` fo
|
|
|
310
310
|
|
|
311
311
|
| Error / symptom | Fix |
|
|
312
312
|
|---|---|
|
|
313
|
+
| Codex says `Organization settings could not be loaded`, or the bridge reports `INVALID_MANAGED_CONFIG` | Check the managed `requirements.toml` at `%ProgramData%\OpenAI\Codex\requirements.toml` on Windows or `/etc/codex/requirements.toml` on macOS/Linux. If it defines `allowed_sandbox_modes`, the list must include `"read-only"` alongside any other allowed modes. Ask the machine administrator to correct it, then run `codex doctor --summary --ascii`. The bridge reports this error before trying to start an external app-server; it does not change managed policy. |
|
|
313
314
|
| `codex binary not found`, `ENOENT`, or Windows `EINVAL` during registration | Locate the actual executable. Set `CODEX_EXE` before rerunning the installer: PowerShell `$env:CODEX_EXE = (Get-Command codex.exe).Source`; macOS/Linux `export CODEX_EXE="$(command -v codex)"`. On Windows, do not point it at `codex.ps1` or `codex.cmd`. |
|
|
314
315
|
| Tools appear in Claude Desktop but not in its Code task | Complete the separate [Claude Code registration](#register-claude-code), then reconnect `/mcp` in that Code session. |
|
|
315
316
|
| Installer refuses an entry with custom access/timeout settings | Keep those settings. Update only the existing entry's `command` and `args` to the values printed by the installer, then reconnect. |
|
package/package.json
CHANGED
package/scripts/check.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
|
2
2
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { readManagedRequirementsIssue } from "../src/app-server-client.mjs";
|
|
5
6
|
import { desktopTasksConfigured } from "../src/native-relay.mjs";
|
|
6
7
|
|
|
7
8
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
@@ -40,6 +41,8 @@ const transport = new StdioClientTransport({
|
|
|
40
41
|
const client = new Client({ name: "bridge-check", version: "1.0.0" });
|
|
41
42
|
|
|
42
43
|
try {
|
|
44
|
+
const managedIssue = readManagedRequirementsIssue();
|
|
45
|
+
if (managedIssue) throw new Error(managedIssue);
|
|
43
46
|
await client.connect(transport);
|
|
44
47
|
const tools = await client.listTools();
|
|
45
48
|
console.log("tools:", tools.tools.map((t) => t.name).join(", "));
|
|
@@ -22,7 +22,7 @@ import { createReleaseSnapshot, snapshotRoot } from "../src/release-snapshot.mjs
|
|
|
22
22
|
|
|
23
23
|
exitForVersionRequest(import.meta.url);
|
|
24
24
|
|
|
25
|
-
const VERSION = "1.19.
|
|
25
|
+
const VERSION = "1.19.4";
|
|
26
26
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
27
27
|
const entry = path.join(root, "src", "mcp-supervisor.mjs");
|
|
28
28
|
const entryArgs = ["native-relay-companion.mjs"];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { execFileSync, spawn } from "node:child_process";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
2
4
|
import { setTimeout as delay } from "node:timers/promises";
|
|
3
5
|
|
|
4
6
|
import { PLATFORM_LABEL, resolveCodexBin, spawnEnv } from "./platform.mjs";
|
|
@@ -8,6 +10,24 @@ const DEFAULT_URL = "ws://127.0.0.1:8791";
|
|
|
8
10
|
const CONNECT_ATTEMPTS = 2;
|
|
9
11
|
const CONNECT_RETRY_DELAY_MS = 750;
|
|
10
12
|
|
|
13
|
+
function managedRequirementsPath() {
|
|
14
|
+
return process.platform === "win32"
|
|
15
|
+
? path.join(process.env.ProgramData ?? process.env.PROGRAMDATA ?? "C:\\ProgramData", "OpenAI", "Codex", "requirements.toml")
|
|
16
|
+
: "/etc/codex/requirements.toml";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function readManagedRequirementsIssue(filePath = managedRequirementsPath()) {
|
|
20
|
+
let contents;
|
|
21
|
+
try {
|
|
22
|
+
contents = readFileSync(filePath, "utf8");
|
|
23
|
+
} catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const sandboxModes = /^\s*allowed_sandbox_modes\s*=\s*\[([\s\S]*?)\]/m.exec(contents);
|
|
27
|
+
if (!sandboxModes || /["']read-only["']/.test(sandboxModes[1])) return null;
|
|
28
|
+
return `Codex managed requirements at ${filePath} are invalid: allowed_sandbox_modes must include "read-only". Ask the machine administrator to repair the policy, then run codex doctor. The bridge does not edit managed policy files.`;
|
|
29
|
+
}
|
|
30
|
+
|
|
11
31
|
export function parseListeningPids(output, port) {
|
|
12
32
|
const suffix = `:${port}`;
|
|
13
33
|
return [
|
|
@@ -81,6 +101,7 @@ export class CodexAppServerClient {
|
|
|
81
101
|
this.url = options.url ?? process.env.CODEX_APP_SERVER_URL ?? DEFAULT_URL;
|
|
82
102
|
assertAllowedAppServerUrl(this.url);
|
|
83
103
|
this.codexBin = resolveCodexBin(options.codexBin);
|
|
104
|
+
this.requirementsPath = options.requirementsPath ?? managedRequirementsPath();
|
|
84
105
|
this.autoStart = options.autoStart ?? process.env.CODEX_BRIDGE_AUTOSTART !== "0";
|
|
85
106
|
this.log = options.log ?? (() => {});
|
|
86
107
|
const requestedApproval = options.approval ?? process.env.CODEX_BRIDGE_APPROVAL ?? "deny";
|
|
@@ -119,6 +140,8 @@ export class CodexAppServerClient {
|
|
|
119
140
|
}
|
|
120
141
|
|
|
121
142
|
async startServer() {
|
|
143
|
+
const managedIssue = readManagedRequirementsIssue(this.requirementsPath);
|
|
144
|
+
if (managedIssue) throw new AppServerError(managedIssue, "INVALID_MANAGED_CONFIG");
|
|
122
145
|
this.log(`starting shared app-server on ${PLATFORM_LABEL}: ${this.codexBin} app-server --listen ${this.url}`);
|
|
123
146
|
const needsShell = /\.(cmd|bat)$/i.test(this.codexBin);
|
|
124
147
|
const child = spawn(this.codexBin, ["app-server", "--listen", this.url], {
|
|
@@ -194,6 +217,7 @@ export class CodexAppServerClient {
|
|
|
194
217
|
lastError = err;
|
|
195
218
|
this.#assertConnectionEpoch(epoch);
|
|
196
219
|
this.log(`connect attempt ${attempt}/${CONNECT_ATTEMPTS} failed: ${err.message}`);
|
|
220
|
+
if (err.code === "INVALID_MANAGED_CONFIG") throw err;
|
|
197
221
|
if (attempt < CONNECT_ATTEMPTS) await delay(CONNECT_RETRY_DELAY_MS);
|
|
198
222
|
}
|
|
199
223
|
}
|
package/src/claude-bridge.mjs
CHANGED
|
@@ -26,7 +26,7 @@ import { AGENT_PROMPT_GUIDANCE, PROMPT_FIELD_HINT } from "./prompt-guidance.mjs"
|
|
|
26
26
|
|
|
27
27
|
exitForVersionRequest(import.meta.url);
|
|
28
28
|
|
|
29
|
-
const VERSION = "1.19.
|
|
29
|
+
const VERSION = "1.19.4";
|
|
30
30
|
void import("./telemetry.mjs").then(({ startUsageReporting }) => startUsageReporting({ version: VERSION })).catch(() => {});
|
|
31
31
|
const FORWARD_MIN_INTERVAL_MS = 5000;
|
|
32
32
|
const FORWARD_MAX_PER_SESSION = 50;
|
package/src/index.mjs
CHANGED
|
@@ -34,7 +34,7 @@ import { AGENT_PROMPT_GUIDANCE, PROMPT_FIELD_HINT } from "./prompt-guidance.mjs"
|
|
|
34
34
|
|
|
35
35
|
exitForVersionRequest(import.meta.url);
|
|
36
36
|
|
|
37
|
-
const VERSION = "1.19.
|
|
37
|
+
const VERSION = "1.19.4";
|
|
38
38
|
void import("./telemetry.mjs").then(({ startUsageReporting }) => startUsageReporting({ version: VERSION })).catch(() => {});
|
|
39
39
|
const log = (msg) => process.stderr.write(`[codex-mcp-bridge] ${msg}\n`);
|
|
40
40
|
|
|
@@ -34,7 +34,7 @@ import { createHardenedRootPolicy } from "./hardened-root-policy.mjs";
|
|
|
34
34
|
|
|
35
35
|
exitForVersionRequest(import.meta.url);
|
|
36
36
|
|
|
37
|
-
const VERSION = "1.19.
|
|
37
|
+
const VERSION = "1.19.4";
|
|
38
38
|
const log = (msg) => process.stderr.write(`[native-relay] ${msg}\n`);
|
|
39
39
|
|
|
40
40
|
function errorResponse(code, message, sent) {
|