Skip to content

refactor: share Codex session execution - #917

Open
mldangelo-oai wants to merge 15 commits into
mainfrom
mdangelo/codex/shared-codex-execution
Open

mldangelo-oai wants to merge 15 commits into
mainfrom
mdangelo/codex/shared-codex-execution

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Share streamed-turn handling between Standard scans and Deep workers. Preserve each session’s selected provider and authentication settings through concurrent and reconstructed workers.

Changes

  • Use one internal stream reducer; callers retain permissions, cancellation, retries and artifact acceptance.
  • Snapshot only the selected provider and resolved worker settings beside the per-session preflight configuration.
  • Bundle shared imports and cover child-process behavior, installed SDKs and physically detached plugins.

Testing

  • At 2877c44, SDK types, formatting, stock package build/check and installed/detached controls passed. Package controls cover default Python discovery, Python-only PATH and an explicit executable path containing spaces, plus discovery, reducers, checkpoints, retry, restart and sealed results.
  • Three fresh native reviews against current main e418d41 and a distinct source/provenance audit passed without findings.
  • Earlier full SDK orders each recorded 3,085 passed /50 skipped /1 pre-existing Git-fixture failure. These precede the final fixture-only correction; they are supporting evidence, not final-head full-suite passes. Original setup failures remain recorded.
  • Final-head platform CI remains pending publication. No new live-model evaluation was run.

Risk and rollout

This internal change adds no command, setting, result field, dependency, migration or scheduler policy. Standard and Deep retain their intentional permission differences and follow-up behavior. Older SDKs without worker snapshots retain their inherited-home behavior. Linux package controls do not establish native Windows/macOS equivalence.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 2135d4c32372f5fd4d7acf1f9839926c450944c7, including adapter behavior, provider forwarding, unknown-usage completion and the MCP-only/installed build paths.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T19:48:59.432452Z 2877c44 New commits
🔒 Security Review Completed 2026-09-16T19:48:57.967207Z 2877c44 New commits

Security findings

Blocking findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 2135d4c323

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 0b43c3f4741609f1d5ac27a9db5e1b700538ce36: shared stream handling, per-session provider and authentication selections, cancellation and reconstruction, and installed/standalone build behavior. The PR body records the known full-suite Git fixture failure and offline-install limitation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 0b43c3f474

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mldangelo-oai
mldangelo-oai marked this pull request as ready for review September 16, 2026 11:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 0b43c3f474

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/src/config.ts Outdated
"model_reasoning_effort",
"model_reasoning_summary",
"service_tier",
"model_providers",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

P0 Badge Security: Keep provider secrets out of the worker snapshot

When codexOverrides.model_providers contains an embedded credential (including in an unrelated provider), this loop copies the entire table into <CODEX_SECURITY_CONFIG_PATH>.workers.toml. Every scan child receives the base path, and its filesystem profile grants root read, so repository-controlled instructions can read the predictable sibling and return the credential in a model request. This bypasses the existing sanitized preflight projection. Store the worker snapshot outside scan-readable paths or project only the selected provider without exposing secrets.

SECURITY.md reference: SECURITY.md:L94-L100


Dismiss this finding: Reply with @codex security dismiss <reason> [context]. Codex will resolve this conversation automatically; GitHub may require a page refresh to show the result.

Valid reasons: false-positive, duplicate, out-of-scope, compensating-control, risk-accepted, or other. Example: @codex security dismiss duplicate Already flagged by another review

What each reason means
  • false-positive — Not a vulnerability
  • duplicate — Already tracked elsewhere
  • out-of-scope — Outside this review's scope
  • compensating-control — Mitigated by another control
  • risk-accepted — Risk intentionally accepted
  • other — Another reason; context required

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2877c44477

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

isObject(providers) &&
Object.hasOwn(providers, selected)
) {
result["model_providers"] = { [selected]: providers[selected]! };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep selected provider credentials out of the worker snapshot

When the selected custom provider contains literal credentials such as experimental_bearer_token or an authorization value in http_headers, this assignment preserves them verbatim in the predictable <CODEX_SECURITY_CONFIG_PATH>.workers.toml file. The file is written before both Standard and Deep parent sessions start, and their root-read sandbox plus the exported config path lets repository-controlled instructions read the credential and return it in a model request or scan artifact. Fresh evidence in this head is the new config.test.ts case explicitly asserting that these selected-provider secret fields survive, even though unrelated providers are now removed. Project only non-secret settings, or explicitly deny the snapshot path to scan processes.

AGENTS.md reference: sdk/typescript/AGENTS.md:L8-L12

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant