Skip to content

Conversation

@lopopolo-openai
Copy link
Contributor

Summary

  • add an env option for the TypeScript Codex client and plumb it into CodexExec so the CLI can run without inheriting process.env
  • extend the test spy to capture spawn environments, add coverage for the new option, and document how to use it

Testing

  • pnpm test (fails: corepack cannot download pnpm because outbound network access is blocked in the sandbox)

Codex Task

@lopopolo-openai lopopolo-openai enabled auto-merge (squash) November 14, 2025 17:32
@lopopolo-openai
Copy link
Contributor Author

> @openai/[email protected] test /home/runner/work/codex/codex/sdk/typescript
> jest

FAIL tests/runStreamed.test.ts
  ● Test suite failed to run

    src/exec.ts:110:11 - error TS2322: Type '{ [x: string]: string; } | { [key: string]: string | undefined; TZ?: string | undefined; }' is not assignable to type 'Record<string, string>'.
      Type '{ [key: string]: string | undefined; TZ?: string; }' is not assignable to type 'Record<string, string>'.
        'string' index signatures are incompatible.
          Type 'string | undefined' is not assignable to type 'string'.
            Type 'undefined' is not assignable to type 'string'.

    110     const env: Record<string, string> = {
                  ~~~

FAIL tests/abort.test.ts
  ● Test suite failed to run

    src/exec.ts:110:11 - error TS2322: Type '{ [x: string]: string; } | { [key: string]: string | undefined; TZ?: string | undefined; }' is not assignable to type 'Record<string, string>'.
      Type '{ [key: string]: string | undefined; TZ?: string; }' is not assignable to type 'Record<string, string>'.
        'string' index signatures are incompatible.
          Type 'string | undefined' is not assignable to type 'string'.
            Type 'undefined' is not assignable to type 'string'.

    110     const env: Record<string, string> = {
                  ~~~

FAIL tests/run.test.ts
  ● Test suite failed to run

    src/exec.ts:110:11 - error TS2322: Type '{ [x: string]: string; } | { [key: string]: string | undefined; TZ?: string | undefined; }' is not assignable to type 'Record<string, string>'.
      Type '{ [key: string]: string | undefined; TZ?: string; }' is not assignable to type 'Record<string, string>'.
        'string' index signatures are incompatible.
          Type 'string | undefined' is not assignable to type 'string'.
            Type 'undefined' is not assignable to type 'string'.

    110     const env: Record<string, string> = {

@codex fix this please

@chatgpt-codex-connector
Copy link
Contributor

Summary

  • Updated CodexExec so that it clones the provided environment override or filters undefined entries from process.env, ensuring the CLI receives a strict Record<string, string> and preventing the TypeScript build error. sdk/typescript/src/exec.tsL105-L133

Testing

  • ⚠️ pnpm test (fails: corepack cannot download pnpm because outbound network access is blocked in the sandbox)

View task →

@lopopolo-openai lopopolo-openai merged commit 9366500 into main Nov 14, 2025
10 checks passed
@lopopolo-openai lopopolo-openai deleted the codex/modify-codex-entrypoint-to-override-environment branch November 14, 2025 19:44
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants