镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(cli): support custom inference providers in patch commands - #1131

Merged
ianw-oai merged 3 commits into
mainfrom
fix/patch-custom-providers
Oct 1, 2026
Merged

ianw-oai merged 3 commits into
mainfrom
fix/patch-custom-providers

Conversation

@ianw-oai

@ianw-oai ianw-oai commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Standalone patch commands reject custom inference-provider settings that scans accept. Allow the same provider selection and configuration to reach Codex.

Changes

  • Accept model_provider and model_providers in the shared patch, validate, and verify-fix override path.
  • Pass the selected provider to authentication and the Codex process. Preserve provider tables, command authentication, and patch-risk assessment settings.
  • Keep sandbox, approval, and plugin overrides restricted.
  • Share CLI help text, document the existing --codex syntax, and add regression coverage. No new flags or default changes.

Testing

Passed:

  • 40 focused tests covering skill commands, provider configuration, patch-risk assessment, and scan-to-patch settings.
  • pnpm run build:ci
  • pnpm run types
  • pnpm run format
  • git diff --check

The new provider regression failed before the fix and passes after it. Tests use synthetic providers and mock model calls; no live inference gateway was contacted.

The four-file skill/patch/authentication suite is not green in this local runtime: filesystem ownership checks and Git checkout checks fail. The unchanged base has the same 52 distinct failure names. The two added authentication cases also encounter this environment limitation. The full seeded suite was stopped after reproducing these environment failures; hosted CI is still required.

Risk and rollout

This uses the existing provider serialization and authentication path. The shared skill runner also makes these provider overrides available to validation and fix verification. Existing model defaults, sandbox policies, and approval policies do not change. Provider settings are scoped to each command. Merge and a CLI release are required before users receive the fix.

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.

@github-actions github-actions Bot added the bug Something isn't working label Sep 30, 2026

@soyeon-oai soyeon-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code review LGTM: traced custom-provider parsing/serialization, authentication and environment forwarding into standalone patch and patch-risk flows, including dotted provider IDs. No actionable regression found. This remains a draft; hosted Windows tests-2 has two Python-executable failures in import-scan tests, so CI is not fully green. I did not independently run tests or reproduce those failures on the base.

@soyeon-oai
soyeon-oai marked this pull request as ready for review October 1, 2026 16:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 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-10-01T17:12:28.904031Z c792ab8 New commits
🔒 Security Review ✅ Completed 2026-10-01T17:14:18.288017Z c792ab8 New commits
ℹ️ 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 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: 2f8d085c63

ℹ️ 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".

Comment thread sdk/typescript/src/cli.ts
Comment on lines 7623 to +7627
command: verify ? "verify-fix" : patch || assess ? "patch" : "validate",
auth: options.auth ?? "auto",
directory,
modelProvider: options.provider,
providerConfiguration: options.providerConfiguration,
modelProvider: provider,
providerConfiguration,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor custom provider keys in API-key mode

When validate, patch, or verify-fix is run with --auth api-key and a custom provider whose credential is declared through model_providers.<name>.env_key (for example, the documented GATEWAY_API_KEY), forwarding the provider here causes runCodexSkillCommand to call scanAuthentication, but that function recognizes provider-specific keys only for the built-in external providers and otherwise requires OPENAI_API_KEY or CODEX_API_KEY. The command therefore throws before spawning Codex unless the user supplies an unrelated OpenAI key; derive API-key authentication from providerConfiguration.env_key for configured custom providers.

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: c792ab86ea

ℹ️ 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".

Comment thread sdk/typescript/src/cli.ts
Comment on lines +7404 to +7405
const provider =
options.provider ?? (overrides["model_provider"] as string | undefined);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Forward Bedrock's reasoning-summary default

When a standalone validate, patch, or verify-fix selects model_provider="amazon-bedrock", mergedCodexConfig deliberately computes model_reasoning_summary="none" because some Bedrock models reject reasoning.summary (config.ts:225-227), but this path discards that effective property and later forwards only the model and effort. The allowlist also rejects an explicit model_reasoning_summary override, so affected models have no workaround and can reject the request before the skill runs; forward the effective Bedrock summary setting along with the newly accepted provider.

Useful? React with 👍 / 👎.

@ianw-oai
ianw-oai merged commit 62e8643 into main Oct 1, 2026
56 checks passed
@ianw-oai
ianw-oai deleted the fix/patch-custom-providers branch October 1, 2026 18:01
@github-actions github-actions Bot mentioned this pull request Oct 1, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants