@sagentlab/navarch-runtime 0.1.89 → 0.1.90
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/dist/browser-probe.cjs +25 -2
- package/dist/worktree-guard.cjs +13 -1
- package/package.json +1 -1
package/dist/browser-probe.cjs
CHANGED
|
@@ -192,7 +192,17 @@ async function probeCodexSandbox(config, deps) {
|
|
|
192
192
|
readRoots: [node_path_1.default.dirname(await node_fs_1.promises.realpath(process.execPath)), node_path_1.default.dirname(playwrightDir)],
|
|
193
193
|
});
|
|
194
194
|
const env = { NAVARCH_PROBE_PLAYWRIGHT: playwrightDir };
|
|
195
|
-
for (const key of [
|
|
195
|
+
for (const key of [
|
|
196
|
+
"HOME",
|
|
197
|
+
"PATH",
|
|
198
|
+
"TMPDIR",
|
|
199
|
+
"CODEX_HOME",
|
|
200
|
+
"PLAYWRIGHT_BROWSERS_PATH",
|
|
201
|
+
"XDG_CACHE_HOME",
|
|
202
|
+
// Agent sessions inherit it; without it Node falls back to the default
|
|
203
|
+
// config path, which can disagree with what sessions actually load.
|
|
204
|
+
"OPENSSL_CONF",
|
|
205
|
+
]) {
|
|
196
206
|
if (process.env[key])
|
|
197
207
|
env[key] = process.env[key];
|
|
198
208
|
}
|
|
@@ -204,12 +214,16 @@ async function probeCodexSandbox(config, deps) {
|
|
|
204
214
|
// bwrap could not find the program it was asked to start inside the
|
|
205
215
|
// sandbox view: a path outside the granted read roots, not an old CLI.
|
|
206
216
|
const hidden = /bwrap: execvp .*No such file or directory/.test(output);
|
|
217
|
+
const opensslConfig = /OpenSSL configuration error/.test(output);
|
|
207
218
|
return ("Could not verify a browser inside the Codex sandbox: `codex sandbox` did not run the probe " +
|
|
208
219
|
`(${result.timedOut ? "timed out" : output.trim() ? summarizeLaunchFailure(output) : `exit ${result.code}`}). ` +
|
|
209
220
|
(hidden
|
|
210
221
|
? "The sandbox cannot see that executable; add its install directory to NAVARCH_GUARD_EXTRA_ROOTS, " +
|
|
211
222
|
"or run browser tasks with another agent."
|
|
212
|
-
:
|
|
223
|
+
: opensslConfig
|
|
224
|
+
? "Node cannot read its OpenSSL config inside the sandbox, so Codex sessions cannot run node either; " +
|
|
225
|
+
"update the Navarch runtime, or add that file's directory to NAVARCH_GUARD_EXTRA_ROOTS."
|
|
226
|
+
: "Update the Codex CLI, or run browser tasks with another agent."));
|
|
213
227
|
}
|
|
214
228
|
const detail = result.timedOut ? "the launch timed out." : summarizeLaunchFailure(output);
|
|
215
229
|
const machPort = /bootstrap_check_in|MachPortRendezvous|mach_port_rendezvous/i.test(output);
|
|
@@ -236,6 +250,15 @@ function summarizeLaunchFailure(output) {
|
|
|
236
250
|
// "[pid=1][err] [1001/210406.593317:FATAL:base/apple/mach_port_rendezvous_mac.cc:159] Check failed: ..."
|
|
237
251
|
return fatal.replace(/^.*FATAL:[^\]]*\]\s*/, "");
|
|
238
252
|
}
|
|
253
|
+
const opensslIndex = lines.findIndex((line) => /OpenSSL configuration error/.test(line));
|
|
254
|
+
if (opensslIndex >= 0) {
|
|
255
|
+
// "<node>: OpenSSL configuration error:" with the reason on the next line:
|
|
256
|
+
// "...:error:80000001:system library:BIO_new_file:Operation not permitted:...:calling fopen(<path>, rb)"
|
|
257
|
+
const reason = lines[opensslIndex + 1] ?? "";
|
|
258
|
+
const cause = /:system library:[^:]*:([^:]+):/.exec(reason)?.[1];
|
|
259
|
+
const file = /fopen\(([^,]+),/.exec(reason)?.[1];
|
|
260
|
+
return `OpenSSL configuration error${cause ? `: ${cause}` : ""}${file ? ` reading ${node_path_1.default.normalize(file)}` : ""}`;
|
|
261
|
+
}
|
|
239
262
|
const missing = lines.find((line) => /Executable doesn't exist/.test(line));
|
|
240
263
|
if (missing)
|
|
241
264
|
return "Chromium is not installed for the runtime's Playwright.";
|
package/dist/worktree-guard.cjs
CHANGED
|
@@ -138,6 +138,9 @@ function codexToolReadRoots(env = process.env, platform = process.platform) {
|
|
|
138
138
|
node_path_1.default.join(miseDataDir(env, homeDir), "installs"),
|
|
139
139
|
node_path_1.default.join(env.NVM_DIR?.trim() || node_path_1.default.join(homeDir, ".nvm"), "versions"),
|
|
140
140
|
...(platform === "darwin" ? MACOS_TOOLCHAIN_READ_ROOTS : []),
|
|
141
|
+
// An operator-chosen OpenSSL config is read by every Node (and OpenSSL
|
|
142
|
+
// CLI) start; the agent inherits OPENSSL_CONF, so the file must be too.
|
|
143
|
+
...(env.OPENSSL_CONF?.trim() ? [env.OPENSSL_CONF.trim()] : []),
|
|
141
144
|
];
|
|
142
145
|
}
|
|
143
146
|
function miseDataDir(env, homeDir) {
|
|
@@ -209,7 +212,16 @@ function resolveExecutable(bin, env) {
|
|
|
209
212
|
* system prefixes for the Claude hook (bin/worktree-guard-hook.cjs), so this
|
|
210
213
|
* only brings the Codex profile level with it.
|
|
211
214
|
*/
|
|
212
|
-
const MACOS_TOOLCHAIN_READ_ROOTS = [
|
|
215
|
+
const MACOS_TOOLCHAIN_READ_ROOTS = [
|
|
216
|
+
"/Library/Developer",
|
|
217
|
+
"/Applications",
|
|
218
|
+
// Official nodejs.org macOS builds (nvm, fnm, volta, the .pkg installer)
|
|
219
|
+
// load OPENSSLDIR/openssl.cnf on every start and exit with "OpenSSL
|
|
220
|
+
// configuration error: ... Operation not permitted" when seatbelt denies
|
|
221
|
+
// the read, so no `node` or `npm` runs. Grant only the file: the directory
|
|
222
|
+
// also holds private/.
|
|
223
|
+
"/System/Library/OpenSSL/openssl.cnf",
|
|
224
|
+
];
|
|
213
225
|
/**
|
|
214
226
|
* Per-user macOS build state that Xcode and SwiftPM write during a build or
|
|
215
227
|
* test run: simulator devices and DerivedData under `~/Library/Developer`,
|
package/package.json
CHANGED