From 6b8ea91ef45ba620cb428e4aeb6a50a82d5a757a Mon Sep 17 00:00:00 2001 From: Alex Bespoyasov Date: Tue, 8 Sep 2026 16:45:42 +0200 Subject: [PATCH 1/3] perf: declare `shell_environment_policy` for Codex onboarding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex exec mode defaults to a restricted shell environment — commands the agent runs don't see proxy settings, npm registry config, or auth tokens from the parent process. On corporate networks this caused npm install to fall back to direct connections that time out, turning a 15-second step into minutes of waiting. Pass `-c 'shell_environment_policy.inherit="core"'` so the agent's commands inherit PATH, HOME, proxy vars, and other essentials. --- __tests__/e2e/onboarding-invocation.e2e.ts | 10 +++++++++- src/integrations/codex/onboarding.ts | 13 ++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/__tests__/e2e/onboarding-invocation.e2e.ts b/__tests__/e2e/onboarding-invocation.e2e.ts index cf738b5..a268e61 100644 --- a/__tests__/e2e/onboarding-invocation.e2e.ts +++ b/__tests__/e2e/onboarding-invocation.e2e.ts @@ -35,7 +35,15 @@ const IDE_CASES = [ name: 'Codex', downPresses: 2, command: 'codex', - expectedArgs: ['exec', '--json', '--sandbox', 'danger-full-access', '-'], + expectedArgs: [ + 'exec', + '--json', + '--sandbox', + 'danger-full-access', + '-c', + 'shell_environment_policy.inherit="core"', + '-', + ], expectedPromptSnippets: [ 'Confidence SDK', '$analyze-project', diff --git a/src/integrations/codex/onboarding.ts b/src/integrations/codex/onboarding.ts index 16cb476..cffcdff 100644 --- a/src/integrations/codex/onboarding.ts +++ b/src/integrations/codex/onboarding.ts @@ -27,7 +27,18 @@ export function runOnboarding( let child: ChildProcess; try { - child = spawn('codex', ['exec', '--json', '--sandbox', 'danger-full-access', '-'], { + child = spawn( + 'codex', + [ + 'exec', + '--json', + '--sandbox', + 'danger-full-access', + '-c', + 'shell_environment_policy.inherit="core"', + '-', + ], + { cwd: opts.projectDir, timeout: ONBOARDING_TIMEOUT_MS, stdio: ['pipe', 'pipe', 'pipe'], From 178f120def13cc0e2b97dd10739aa7448eea6002 Mon Sep 17 00:00:00 2001 From: Alex Bespoyasov Date: Tue, 8 Sep 2026 16:45:49 +0200 Subject: [PATCH 2/3] chore: update skills --- .claude/skills/wizard-integrations/SKILL.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.claude/skills/wizard-integrations/SKILL.md b/.claude/skills/wizard-integrations/SKILL.md index 8d1cb3e..b2f4aac 100644 --- a/.claude/skills/wizard-integrations/SKILL.md +++ b/.claude/skills/wizard-integrations/SKILL.md @@ -120,6 +120,18 @@ The barrel `src/integrations/index.ts` exports: Only import from the barrel or from specific submodules — never reach into an IDE's `index.ts` directly from outside the integrations module. +## IDE-Specific Runtime Constraints + +### Codex: shell environment policy + +Codex `exec` mode defaults to a restricted shell environment — commands the agent runs do not inherit proxy settings, npm auth tokens, or registry config from the parent process. Without `shell_environment_policy.inherit="core"`, `npm install` falls back to direct connections that time out on corporate networks, turning a 15-second install into minutes of waiting. + +Always pass `-c 'shell_environment_policy.inherit="core"'` in Codex `exec` spawn args so the agent's commands see the core parent environment (PATH, HOME, proxy settings, etc.). + +### Codex: `item.completed` event batching + +Codex `exec --json` only emits `item.completed` events — not incremental text deltas. Status lines only surface after the agent finishes an entire message turn. If the agent does MCP calls, file reads, or package installs between messages, the user sees nothing until the next completed message. Claude Code and Cursor stream incrementally via `stream-json`, so their status updates appear in real time. + ## Coding Conventions Follow all conventions from the `wizard-architecture` skill. Additionally: From 64e7a3af04cf3290d885683c3557bedd585cc105 Mon Sep 17 00:00:00 2001 From: Alex Bespoyasov Date: Tue, 8 Sep 2026 16:52:13 +0200 Subject: [PATCH 3/3] chore: prettier --- src/integrations/codex/onboarding.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/integrations/codex/onboarding.ts b/src/integrations/codex/onboarding.ts index cffcdff..77c108f 100644 --- a/src/integrations/codex/onboarding.ts +++ b/src/integrations/codex/onboarding.ts @@ -39,11 +39,12 @@ export function runOnboarding( '-', ], { - cwd: opts.projectDir, - timeout: ONBOARDING_TIMEOUT_MS, - stdio: ['pipe', 'pipe', 'pipe'], - env, - }); + cwd: opts.projectDir, + timeout: ONBOARDING_TIMEOUT_MS, + stdio: ['pipe', 'pipe', 'pipe'], + env, + }, + ); } catch (err) { callbacks.onError(spawnErrorMessage('codex', err as NodeJS.ErrnoException)); return null;