INNER CODE UNIT · TypeScript

systemEnv

lidge-jun/opencodex · src/cli/index.ts:731

  const systemEnv = await injectSystemEnv(port, config).catch(() => ({ injected: false }));
  // The hook is useful only for an installed Claude Code CLI. Reconcile instead of
  // appending unconditionally so stale OpenCodex-owned hooks are removed as well. A sibling
  // skips it: reconciling to "not injected" would uninstall the live owner's ~/.zshrc hook.
  if (!siblingStart) reportShellHookFailure(reconcileShellHook(systemEnv.injected));
  await maybeShowStarPrompt(); // once-only Yes/No GitHub-star prompt on first interactive start
  // Codex sync owns the ready/failed verdict, but its successful transition is
  // deferred until the best-effort Claude roster and Desktop registry settle. This
  // keeps /readyz closed across startup initialization without making an optional
  // Claude integration failure prevent the proxy from starting.
  const catalogHealerModule = siblingStart ? null : await import("../codex/catalog-self-heal");
  const startupSync = await reconcileClientStartupBeforeReady(
    readinessGate,
    gate => syncCodexBeforeCatalogObservation(gate,
      forwarding => syncCodexOnStartIfEnabled(port, config, undefined, forwarding),
      () => {
        if (catalogHealerModule && !siblingStart && !cleaned) catalogHealer = catalogHealerModule.startCodexCatalogSelfHeal({ port });
      }),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…