Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: keep Codex repairs off user MCP tools and protect symlinked credential stores (#12487)
[._.]/ Adam Eivyd5d8c8dc2161
diff --git a/autofixer/sandbox.js b/autofixer/sandbox.jsindex a7fdce99f4..01491a3e0b 100644--- a/autofixer/sandbox.js+++ b/autofixer/sandbox.js@@ -541,10 +541,11 @@ function runGroup(file, args, { cwd, env, timeoutMs, seccomp = null }) {* @param {object} [opts]* @param {string} [opts.dataDir] PortOS data directory to hide from the command* @param {number} [opts.timeoutMs=300000]+ * @param {string} [opts.homeDir] host home whose credential stores are hidden (default: os.homedir())* @param {() => Promise<{ id: string|null, supported: boolean, reason: string|null }>} [opts.probe]* @returns {Promise<{ ok: boolean, code: number, output: string, contained: boolean, mechanism?: string }>}*/-export async function runVerifyCommand(command, cwd, { dataDir = null, timeoutMs = 300000, probe = probeVerifyContainment } = {}) {+export async function runVerifyCommand(command, cwd, { dataDir = null, homeDir = homedir(), timeoutMs = 300000, probe = probeVerifyContainment } = {}) {const mechanism = await probe();if (!mechanism.supported) {return { ok: false, code: -1, contained: false, output: `[verify] refused: no enforced containment for the verify command — ${mechanism.reason}` };@@ -555,10 +556,13 @@ export async function runVerifyCommand(command, cwd, { dataDir = null, timeoutMsconst worktree = await realpath(cwd);const scratch = await realpath(scratchDir);const realOrSelf = (path) => realpath(path).catch(() => path);- const protectedPaths = autofixVerifyProtectedPaths({+ const listed = autofixVerifyProtectedPaths({dataDir: dataDir ? await realOrSelf(dataDir) : null,- realHome: await realOrSelf(homedir()),+ realHome: await realOrSelf(homeDir),});+ // Seatbelt matches resolved paths: a symlinked store (~/.ssh → elsewhere)+ // is protected only through its target, so list both.+ const protectedPaths = [...new Set([...listed, ...await Promise.all(listed.map(realOrSelf))])];const env = autofixVerifyEnv({ scratch, path: process.env.PATH });const shell = ['/bin/sh', '-c', command];let launch;diff --git a/autofixer/sandbox.test.js b/autofixer/sandbox.test.jsindex e3994ebd87..f03bdc8e66 100644--- a/autofixer/sandbox.test.js+++ b/autofixer/sandbox.test.js@@ -170,7 +170,7 @@ describe('buildFixPrompt — untrusted log fencing', () => {describe('pickRepairProvider — only an enforced restricted mode runs a repair', () => {const claude = { id: 'claude-code', type: 'cli', command: 'claude', args: ['--print', '--dangerously-skip-permissions', '--allowedTools', 'Bash', '--add-dir', '/example/live'] };- const codex = { id: 'codex', type: 'cli', command: 'codex', args: ['--dangerously-bypass-approvals-and-sandbox', '--sandbox', 'danger-full-access', '--add-dir', '/example/live', '-C', '/example/live'] };+ const codex = { id: 'codex', type: 'cli', command: 'codex', ignoreUserConfig: true, args: ['--dangerously-bypass-approvals-and-sandbox', '--sandbox', 'danger-full-access', '--add-dir', '/example/live', '-C', '/example/live'] };const gemini = { id: 'gemini-cli', type: 'cli', command: 'gemini', args: ['--yolo'] };const agy = { id: 'antigravity-cli', type: 'cli', command: 'agy', args: ['--print', '--dangerously-skip-permissions'] };// The argv the runner actually spawns: buildCliArgs over the restricted clone.@@ -208,7 +208,12 @@ describe('pickRepairProvider — only an enforced restricted mode runs a repair'expect(argv).not.toContain('--dangerously-bypass-approvals-and-sandbox');expect(argv).not.toContain('danger-full-access');expect(argv).not.toContain('/example/live');- expect(argv.join(' ')).toContain('--sandbox workspace-write -c sandbox_workspace_write.network_access=false -c sandbox_workspace_write.writable_roots=[]');+ expect(argv.join(' ')).toContain([+ '--sandbox workspace-write --ignore-user-config',+ '-c sandbox_workspace_write.network_access=false -c sandbox_workspace_write.writable_roots=[]',+ '-c features.plugins=false -c features.apps=false',+ ].join(' '));+ expect(argv.filter((arg) => arg === '--ignore-user-config')).toHaveLength(1);expect(argv.at(-1)).toBe('-');});});diff --git a/autofixer/sandbox.verify.test.js b/autofixer/sandbox.verify.test.jsindex db59891043..3d10ad121c 100644--- a/autofixer/sandbox.verify.test.js+++ b/autofixer/sandbox.verify.test.js@@ -1,5 +1,5 @@import { describe, it, expect, beforeAll, afterAll, vi } from 'vitest';-import { mkdtemp, mkdir, rm, writeFile, readFile, access } from 'node:fs/promises';+import { mkdtemp, mkdir, rm, writeFile, readFile, access, symlink } from 'node:fs/promises';import { createServer } from 'node:net';import { tmpdir } from 'node:os';import { join } from 'node:path';@@ -17,6 +17,8 @@ describe.skipIf(!mechanism.supported)(`runVerifyCommand under ${mechanism.id ||let port;let unixServer;let socketPath;+ let home;+ let keyStore;beforeAll(async () => {// Linux hides /tmp and /run behind tmpfs; /var/tmp keeps the socket below@@ -28,6 +30,13 @@ describe.skipIf(!mechanism.supported)(`runVerifyCommand under ${mechanism.id ||await mkdir(worktree, { recursive: true });await mkdir(outside);await writeFile(join(dataDir, 'providers.json'), '{"apiKey":"example-provider-key"}');+ // A credential store reached through a symlink (~/.ssh → elsewhere).+ home = join(root, 'home');+ keyStore = join(root, 'key-store');+ await mkdir(home);+ await mkdir(keyStore);+ await writeFile(join(keyStore, 'id_example'), 'example-private-key');+ await symlink(keyStore, join(home, '.ssh'));server = createServer((socket) => socket.end('reached'));await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));port = server.address().port;@@ -44,7 +53,7 @@ describe.skipIf(!mechanism.supported)(`runVerifyCommand under ${mechanism.id ||await rm(root, { recursive: true, force: true });});- const verify = (command) => runVerifyCommand(command, worktree, { dataDir, timeoutMs: 30000 });+ const verify = (command) => runVerifyCommand(command, worktree, { dataDir, homeDir: home, timeoutMs: 30000 });it('runs a forking test command that writes inside the worktree', async () => {const result = await verify('echo built > out.txt && (cat out.txt) && sh -c "exit 0"');@@ -78,6 +87,14 @@ describe.skipIf(!mechanism.supported)(`runVerifyCommand under ${mechanism.id ||expect(net.output).not.toContain('reached');});+ it('cannot read a symlinked credential store through the link or its target', async () => {+ for (const path of [join(home, '.ssh', 'id_example'), join(keyStore, 'id_example')]) {+ const result = await verify(`cat ${JSON.stringify(path)}`);+ expect(result.ok).toBe(false);+ expect(result.output).not.toContain('example-private-key');+ }+ });+it('cannot connect to a host pathname Unix socket', async () => {const unix = await verify(connectProbe(`'${socketPath}'`));expect(unix.ok).toBe(false);diff --git a/server/lib/README.md b/server/lib/README.mdindex fa9132afcf..f72a91828d 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -269,7 +269,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `videoTextEncoders.js` | Swappable prompt conditioners for local video runtimes. MiniMax H3 reads the *unnormalized* hidden state after Qwen3-VL language layer 49 (layers 50-63, the final norm and `lm_head` are never evaluated), so any checkpoint carrying the same embedding + layers 0-49 + vision tower is a drop-in conditioner — swapping it changes how the model reads a prompt without touching the diffusion weights. `TEXT_ENCODERS_BY_RUNTIME` declares the shipped options per runtime (pinned repo/revision plus an explicit `files` LIST — one repackaged safetensors, or just the shards of an upstream checkpoint that carry parameters the loader actually builds; in code rather than the media-models registry so a stale `data/media-models.json` can't name a file the runner can't map); `videoTextEncoderOptions(model)` returns the TRUE list stock-first (it deliberately does NOT collapse a one-entry runtime to `[]` — that is a presentation rule, and folding it in here would change what the server believes a model supports and empty the "offers …" list in the error; `TextEncoderPicker` owns the hide-when-there-is-no-real-choice check), `isStockTextEncoder(id)` makes absence and the `stock` sentinel the same request, `resolveVideoTextEncoder(model, id)` returns `null` for the stock choice or throws `VIDEO_TEXT_ENCODER_UNSUPPORTED` (with the non-throwing `supportsVideoTextEncoder` + `videoTextEncoderUnsupportedError` split out so the request path can reject before staging uploads), and `downloadableVideoTextEncoders()` (deduped by id — the table is keyed by RUNTIME, so one conditioner can be offered by two) / `downloadableVideoTextEncoder(id)` feed the `/api/video-gen/text-encoders/:id/(download\|repair)` lane. Two loader-mechanics fields exist because a ComfyUI-packaged conditioner is namespaced differently from the HF checkpoint the MLX port matches: `keyPrefixMap` (`model.` → `model.language_model.`, `visual.` → `model.visual.`) is applied to every checkpoint key by `scripts/generate_minimax_h3.py` BEFORE the pinned loader sees it — no fork of the pinned runtime — and `finalNormKey` names where the runner synthesizes a ones-filled `norm.weight` for a checkpoint published without one (correct upstream, since H3 reads the state *before* the norm, but the pinned loader refuses to load with any parameter missing). Both are absent for an UPSTREAM Qwen3-VL-32B checkpoint, which already uses the loader namespace and ships its own norm. A candidate must BE Qwen3-VL-32B (the shim reuses upstream's config/tokenizer/processor) — a different Qwen generation is not a substitute however close its conditioning width looks; see docs/features/video-text-encoders.md. `publicTextEncoderOption(entry)` is the client projection and deliberately drops both, so the UI can't reimplement the remap. The `ltx25` table (#4320) uses a third mechanic, `configOverrides`, because an LTX-2.5 pack's OWN Gemma 4 tower wins over `--gemma` inside the pinned fork: the substitution is a standalone shim directory whose generated `config.json` is the substitute's own with these keys merged over it (only ever the `model_type` label a unified checkpoint gets wrong — never `text_config`/`quantization`), and a candidate must BE Gemma 4 12B at 48 layers / hidden 3840 / vocab 262144 / `k_eq_v`. `verified` gates a substitute out of BOTH lanes (picker AND download) until it has been A/B-rendered against its runtime's stock conditioner — required on every non-built-in entry and fail-closed on absence, so a new entry is unreachable until someone states a verdict; both ltx25 substitutes are `verified: false` today. `declaredVideoTextEncoders()` is the UNFILTERED table for shape/invariant checks only — never the render or download path, and `videoTextEncoderRuntimes()` enumerates the table's runtime keys so parity/shape tests cover every runtime rather than the one that happened to exist when they were written. || `pi.js` | Pi command identity, headless/TUI arguments, and positional prompt delivery. || `providerModels.js` | Provider model resolution sentinels + helpers (`CODEX_CONFIGURED_DEFAULT` / `ANTIGRAVITY_CONFIGURED_DEFAULT` / `GROK_CONFIGURED_DEFAULT` / `KIMI_CONFIGURED_DEFAULT`, `resolveCliModel`, `filterSelectableModels`, Bedrock/OpenCode model mappers, `localRuntimeNamespace(provider)` — the OpenCode namespace only when it names a LOCAL daemon, i.e. the composed "namespace and not a hosted gateway" test that `cliChildEnv.js`, `localProviderRuntime.js` and `providerVendors.js` all key on, `CODEX_OSS_LOCAL_PROVIDERS` / `CODEX_OSS_MIN_VERSION` / `codexOssLocalProvider` / `codexUnsupportedLocalRuntime` — the codex half of that same axis: which local runtimes Codex's `--local-provider` can serve, and which marked runtime it cannot, kept here beside the namespace they wrap so `providerPrerequisites.js` classifies a codex record without importing `codex.js` (the argv emitter, `buildCodexOssArgs`, stays there), `OPENCODE_PUBLIC_REVIEW_AGENT` — the read-only OpenCode agent a no-tool public-review stage runs as, kept in this leaf because `providerVendors.js` must not import `opencodeConfig.js`, `parseOpencodeConfigContent` — the shared "is this stored OPENCODE_CONFIG_CONTENT usable?" read — plus `opencodeConfigIsLocalOnly` / `opencodeProviderIsLocalOnly`, the ONE locality rule `providerVendors.js` (gate eligibility) and `cliChildEnv.js` (public-review env allowlist) must not disagree about: if eligibility says yes where the allowlist strips the config, the stage spawns against the user's own ~/.config/opencode with tools intact while still reporting an enforced tool-free gate, `normalizeClaudeModelId` / `resolveClaudeCliModel` — the Claude-argv chokepoint that rewrites a dotted first-party version (`claude-fable-5.1`) to the dashed id Claude Code actually serves before the Bedrock mapping runs, model-flag scan helpers incl. `stripBrokenModelFlags` and `stripProviderPinArgs` (explicit per-run selections override baked CLI pins), `isCodexProvider`, `isKimiProvider`, `isAntigravityProvider`, `isCursorProvider`) plus the agy catalog family, which reads an `agy models` list as base ids paired with effort tiers (`splitAntigravityModel`, `antigravityBaseModels`, `antigravityModelEffortLevels`, `antigravityCatalogListsModel` — is a stored pin still served? — and `pickAntigravityRelayModel` — the cheapest tier to relay one tool call on when a vendor retires the pin PortOS shipped) plus reasoning-effort helpers for the claude/codex/agy/cursor CLIs (`CLAUDE_EFFORT_LEVELS` / `CODEX_EFFORT_LEVELS` / `ANTIGRAVITY_EFFORT_LEVELS` / `CURSOR_EFFORT_LEVELS` / `EFFORT_LEVELS`, `effortLevelsForProvider`, `resolveCliEffort` — clamps an out-of-range effort to the nearest level the target CLI accepts rather than dropping it, so a value saved against a wider ladder survives a provider switch — `clampEffortToLadder` (that clamp over an explicit ladder; the client's own `resolveCliEffort` runs its published-field ladder through it), `hasEffortFlag`, `buildEffortArgs` — the one emitter of `--effort <level>` / `-c model_reasoning_effort=<level>`, and deliberately silent for cursor — and `foldCursorEffortIntoModel`, which carries a cursor level inside `--model` as Cursor’s own variant syntax (`gpt-5[effort=max]`) because `cursor-agent` has no `--effort` flag) plus codex startup-arg helpers (`CODEX_EFFORT_KEY`, `CODEX_UPDATE_CHECK_KEY`, `hasCodexUpdateCheckConfig`, `buildCodexStartupArgs` — the one emitter of `-c check_for_update_on_startup=false`, spread by every codex spawn builder to disable the blocking startup update modal) plus `PORTOS_CLI_CONFIG_KEYS` / `isPortosSuppliedConfigKey` — the exhaustive list of `-c <key>=<value>` config keys PortOS injects, read by the `cli-config-invalid` error analyzer to tell a rejected PortOS override apart from a bad line in the user's own CLI config file.; `isOpencodeLocalProvider` (the OpenCode-on-a-local-backend-or-gateway gate behind the OpenCode effort ladder) and `isCodexSubscriptionProvider` (the ChatGPT-subscription readiness key, housed here so the browser re-export skips `codexAccount.js`'s protocol tables) |-| `providerVendors.js` | `PROVIDER_VENDORS` — one row per coding-agent CLI/TUI vendor (claude/codex/antigravity/opencode/grok/kimi/cursor, plus a deliberately-incomplete legacy `gemini-cli` row), consumed by every dispatch site that used to hand-roll its own vendor if-chain across ~8 branches in 5 files (#3618): `applyCommandDefaults`/`prepareCliPrompt` (re-exported from `tuiHandshake.js`/`cliProviderArgs.js`), `buildVendorCliArgs`/`buildVendorSpawnConfig` (consumed by `cliProviderArgs.js#buildCliArgs` / `agentCliSpawning.js#buildCliSpawnConfig`), `inferTuiCommand` (re-exported from `tuiHandshake.js`), and `injectTuiModelAndEffort` — the shared antigravity-validates-the-pair-vs-everyone-else `--model`/`--effort` injection used by both `tuiHandshake.js#buildTuiInvocation` and `agentTuiSpawning.js#buildTuiSpawnConfig`, replacing a second copy of that split that had already drifted once before this file existed. Doesn't rewrite any vendor's argv-building logic — that stays in `antigravity.js`/`grok.js`/`kimi.js`/`cursor.js`/`codex.js`. Also `toolFreeOneShotArgs` / `isToolFreeOneShotProvider` / `toolFreeOneShotRefusal` (#9008): the one-shot-over-caller-text posture Ask and AI app detection run — every approval-bypass flag stripped, the vendor tool-disable switch applied where one exists (claude, grok, pi), and host control required for every other CLI. `restrictedRepairArgs` (#12487) is the autofixer repair posture: claude with Bash/web tools denied and edits auto-accepted only in the cwd, or codex in its network-denied workspace-write sandbox, with every saved bypass stripped; null for any other CLI. Dependency-light on purpose, mirroring those files. |+| `providerVendors.js` | `PROVIDER_VENDORS` — one row per coding-agent CLI/TUI vendor (claude/codex/antigravity/opencode/grok/kimi/cursor, plus a deliberately-incomplete legacy `gemini-cli` row), consumed by every dispatch site that used to hand-roll its own vendor if-chain across ~8 branches in 5 files (#3618): `applyCommandDefaults`/`prepareCliPrompt` (re-exported from `tuiHandshake.js`/`cliProviderArgs.js`), `buildVendorCliArgs`/`buildVendorSpawnConfig` (consumed by `cliProviderArgs.js#buildCliArgs` / `agentCliSpawning.js#buildCliSpawnConfig`), `inferTuiCommand` (re-exported from `tuiHandshake.js`), and `injectTuiModelAndEffort` — the shared antigravity-validates-the-pair-vs-everyone-else `--model`/`--effort` injection used by both `tuiHandshake.js#buildTuiInvocation` and `agentTuiSpawning.js#buildTuiSpawnConfig`, replacing a second copy of that split that had already drifted once before this file existed. Doesn't rewrite any vendor's argv-building logic — that stays in `antigravity.js`/`grok.js`/`kimi.js`/`cursor.js`/`codex.js`. Also `toolFreeOneShotArgs` / `isToolFreeOneShotProvider` / `toolFreeOneShotRefusal` (#9008): the one-shot-over-caller-text posture Ask and AI app detection run — every approval-bypass flag stripped, the vendor tool-disable switch applied where one exists (claude, grok, pi), and host control required for every other CLI. `restrictedRepairArgs` (#12487) is the autofixer repair posture: claude with Bash/web tools denied and edits auto-accepted only in the cwd, or codex in its network-denied workspace-write sandbox without user config, plugins or apps, with every saved bypass and extra writable directory stripped; null for any other CLI. Dependency-light on purpose, mirroring those files. || `publicReviewSpawnGate.js` | The ordered spawn-time preconditions a public-content review stage must clear before `runAgentSpawn` starts an agent for it — `checkPublicReviewSpawnPreconditions` returns the FIRST failing gate as `{ reason, category, emit }` (or null), running them in the order that is the contract: `publicReviewScanBlock` (the model-abuse scan cleared at least one PR), `publicReviewEligibilityBlock` (a complete eligibility verdict COVERING every PR the issue watcher saw — a partial gate is not a pass), `publicReviewProviderBlock` from `providerVendors.js` (the vendor row declares a maintained recipe for the requested posture; it owns the ordinary-task `null` posture, the re-derivation #5866 got wrong), then the model itself. `emit` tells the caller how to announce it: `warn-log` for the two fail-closed CONTENT gates, whose block must not raise an investigator that could retry the same unvalidated input, `agent:error` for a provider/model misconfiguration that should. `validateModel` is injected rather than imported — it is the one gate that probes a live runtime, so taking it as a parameter keeps this leaf out of the local-LLM graph and makes the gate ORDER testable with a stub. || `modelCapabilityTests.js` | Catalog + scoring for the CAPABILITY tests on `/models/performance` (run by `services/modelCapabilityTests.js`): `CAPABILITY_TESTS` (sandbox repair / image analysis / story outline / fiction scene / rhetoric evaluator, each gated on the capability badges the install catalog already shows), `applicabilityFor` + `applicableTests` (`applicable` / `not-applicable` / `unknown` — an UNCLAIMED capability is never a failure, and `null` capabilities mean the runtime reported none, which is distinct from `[]`), `scoreKeywords` + `VISION_FIXTURE_KEYWORDS` (required vs bonus terms, word-boundary matched with a negation guard so "no dog" doesn't score a dog), `scoreStoryBeats` + `HEROS_JOURNEY_BEATS` (coverage AND ordering, judged only over the beats present), `scoreSandboxRepair` (verdict from observed disk facts — editing the test instead of the module fails outright), `formatAgentEvent` (one agent stream frame → a transcript line), `rollUpVerdict`, and the verbatim `CAPABILITY_TEST_PROMPTS` / `SANDBOX_TASK_PROMPT` the consent gate shows. Pure, so any stored transcript can be re-scored with no provider call. || `modelPinMembership.js` | THE model-pin membership rule, and the local-daemon classification it rests on — `modelPinIsOffered(provider, model)` (may this provider be handed this model? a configured-default sentinel, an empty catalog and a local daemon's cached snapshot are all pass-throughs, so a freshly pulled Ollama model is never rejected as "not offered"; beyond those the match is exact, with two same-model-spelled-differently tolerances: agy compares on BASE ids, since `--effort` carries the tier and the spawner splits a suffixed pin into exactly that, and OpenCode's `namespace/model` form matches a bare pin, since pins are stored bare and namespaced at spawn), plus `localRuntimeKind(provider)` (the `*Backed` markers first, then the endpoint/name classifier; `orcarouter` excluded as a remote API) and `localBackendForProvider`. Split out of `localProviderRuntime.js` — which re-exports all three, so existing importers are untouched — because the browser needs this rule for a picker and must not pull that module's endpoint graph (`opencodeConfig.js` → `zod`, not a client dependency) to get it. Carries `LOCAL_RUNTIME_MANAGE_URLS` for the same reason (#7414): the route that manages each local runtime — Models → Runtimes for the servers, Models → LLMs for the weights catalog, `null` for the operator-owned compose projects — read by `LOCAL_RUNTIMES[*].manageUrl` and by the client surfaces that must name the same page. Consumed by `cliProviderRun.js`, `routes/brainSettings.js`, `services/agentProviderResolution.js`, `modelPinReconcile.js` and `client/src/utils/providerModels.js` — one answer for all five (#7327). |diff --git a/server/lib/providerModels.js b/server/lib/providerModels.jsindex cbdd492c2f..25b894d7f1 100644--- a/server/lib/providerModels.js+++ b/server/lib/providerModels.js@@ -727,10 +727,12 @@ export function buildEffortArgs(effort, provider, existingArgs = [], model = nul// edit rather than a four-builder grep.export const CODEX_UPDATE_CHECK_KEY = 'check_for_update_on_startup';export const CODEX_AGENT_THREADS_KEY = 'agents.max_concurrent_threads_per_session';-// Forced off/empty for autofixer repairs (#12487) so a user config cannot open-// the workspace-write sandbox to the network or to writes outside the cwd.+// Forced off/empty for autofixer repairs (#12487): no network or writes outside+// the cwd in the workspace-write sandbox, and no plugin/app tools beside it.export const CODEX_WORKSPACE_NETWORK_KEY = 'sandbox_workspace_write.network_access';export const CODEX_WORKSPACE_WRITABLE_ROOTS_KEY = 'sandbox_workspace_write.writable_roots';+export const CODEX_PLUGINS_FEATURE_KEY = 'features.plugins';+export const CODEX_APPS_FEATURE_KEY = 'features.apps';/*** Give a Codex swarm enough session threads for its root orchestrator plus@@ -812,6 +814,8 @@ export const PORTOS_CLI_CONFIG_KEYS = Object.freeze([CODEX_UPDATE_CHECK_KEY,CODEX_WORKSPACE_NETWORK_KEY,CODEX_WORKSPACE_WRITABLE_ROOTS_KEY,+ CODEX_PLUGINS_FEATURE_KEY,+ CODEX_APPS_FEATURE_KEY,]);/**diff --git a/server/lib/providerModels.test.js b/server/lib/providerModels.test.jsindex c477fabe1d..f0300bf70f 100644--- a/server/lib/providerModels.test.js+++ b/server/lib/providerModels.test.js@@ -44,6 +44,8 @@ import {CODEX_AGENT_THREADS_KEY,CODEX_WORKSPACE_NETWORK_KEY,CODEX_WORKSPACE_WRITABLE_ROOTS_KEY,+ CODEX_PLUGINS_FEATURE_KEY,+ CODEX_APPS_FEATURE_KEY,isPortosSuppliedConfigKey,hasCodexUpdateCheckConfig,buildCodexStartupArgs,@@ -752,6 +754,8 @@ describe('providerModels', () => {CODEX_UPDATE_CHECK_KEY,CODEX_WORKSPACE_NETWORK_KEY,CODEX_WORKSPACE_WRITABLE_ROOTS_KEY,+ CODEX_PLUGINS_FEATURE_KEY,+ CODEX_APPS_FEATURE_KEY,].sort());// Guard against a third emitter appearing without a row: both builders// that produce `-c` are asserted to use a listed key.diff --git a/server/lib/providerVendors.js b/server/lib/providerVendors.jsindex 773d06835c..cfc170eec0 100644--- a/server/lib/providerVendors.js+++ b/server/lib/providerVendors.js@@ -81,6 +81,8 @@ import {applyLeanClaudeArgs,CODEX_WORKSPACE_NETWORK_KEY,CODEX_WORKSPACE_WRITABLE_ROOTS_KEY,+ CODEX_PLUGINS_FEATURE_KEY,+ CODEX_APPS_FEATURE_KEY,} from './providerModels.js';import {isCodexCommand,@@ -1153,11 +1155,15 @@ const CLAUDE_REPAIR_ARGS = ['--setting-sources', 'user','--disallowedTools', 'Bash', 'WebFetch', 'WebSearch',];-// Codex's OS sandbox: writes confined to the working directory, with network-// and extra writable roots forced off even when the user's config.toml sets them.+// Codex's OS sandbox confines its shell commands to the working directory+// with network off. MCP servers, plugins and apps run outside that sandbox+// (computer-use, node_repl), and an `mcp_servers` override cannot clear them,+// so the user's config.toml is not loaded at all (auth still is) and the+// plugin/app surfaces are disabled.const CODEX_REPAIR_ARGS = [- '--sandbox', 'workspace-write',+ '--sandbox', 'workspace-write', '--ignore-user-config','-c', `${CODEX_WORKSPACE_NETWORK_KEY}=false`, '-c', `${CODEX_WORKSPACE_WRITABLE_ROOTS_KEY}=[]`,+ '-c', `${CODEX_PLUGINS_FEATURE_KEY}=false`, '-c', `${CODEX_APPS_FEATURE_KEY}=false`,];/**