Repository navigation
Prevent Codex exec tool rejection with Copilot inference - #65654
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request... |
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
CLI arguments can bypass the new restriction, and the unrelated schema change breaks supported queue expressions.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Configures Codex to disable its unsupported exec tool when using GitHub inference while preserving OpenAI behavior.
Changes:
- Adds provider-specific
shell_toolconfiguration and override validation. - Adds regression tests for GitHub and OpenAI providers.
- Narrows
concurrency.queueschema validation.
| File | Description |
|---|---|
pkg/workflow/codex_config.go |
Adds GitHub-specific Codex configuration. |
pkg/workflow/codex_config_test.go |
Tests generated provider configurations. |
pkg/workflow/schemas/github-workflow.json |
Removes expression support from queue. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| "type": "string", | ||
| "enum": ["single", "max"], |
| if githubProvider { | ||
| if features, ok := config.Overrides["features"].(map[string]any); ok { | ||
| if shellTool, exists := features["shell_tool"]; exists && shellTool != false { | ||
| return errors.New("engine.config: features.shell_tool is disabled for GitHub inference because the Copilot compatibility adapter does not support the Codex exec custom tool") |
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs — requesting changes. The core Codex/Copilot fix (gating features.shell_tool by provider) is well targeted and tested, but two issues need fixing before merge.
📋 Key Themes & Highlights
Key Themes
- Incomplete bypass closure:
validateCodexManagedConfigonly inspects TOMLengine.configoverrides, butengine.args(-c features.shell_tool=true) are appended last inbuildCodexCommandand win over the generated flag, so the guard can be silently bypassed. - Unrelated schema regression: the
concurrency.queueschema change dropsexpressionSyntaxsupport, which breaks the existingTestConcurrencyQueueSchemaValidationexpression case (verified locally — test fails). This looks like an accidental bundling, unrelated to the Codex/Copilot fix described in the PR body.
Positive Highlights
- ✅ Clean, minimal provider-gated config generation (
ResolveLLMProvider(workflowData) == LLMProviderGitHub). - ✅ Good regression tests added for both the default-disabled and rejected-override cases (
TestCodexGitHubInferenceDisablesUnsupportedExecTool,TestCodexGitHubInferenceRejectsExecToolOverride). - ✅ Clear, actionable error message pointing at the root cause (Copilot adapter limitation).
Both existing reviewer comments on this PR (TOML-only validation gap, and the concurrency schema regression) are confirmed valid — see inline comments.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 32.1 AIC · ⌖ 14.6 AIC · ⊞ 10K
Comment /matt to run again
| } | ||
| ], | ||
| "type": "string", | ||
| "enum": ["single", "max"], |
There was a problem hiding this comment.
[/diagnosing-bugs] Confirmed by running go test ./pkg/workflow/ -run TestConcurrencyQueueSchemaValidation: this change makes the existing test fail, because queue with a GitHub Actions expression (e.g. ${{ github.event_name == 'pull_request' && 'single' || 'max' }}) is a documented, tested case that the compiler generates (see concurrency_command_test.go's mixed-PR scenario). Dropping the expressionSyntax branch regresses that feature, not just a theoretical risk.
💡 Test failure output
--- FAIL: TestConcurrencyQueueSchemaValidation (0.01s)
Error: GitHub Actions schema validation failed ... '/concurrency/queue': value must be one of 'single', 'max'
Restore the oneOf with expressionSyntax for queue, or update/remove TestConcurrencyQueueSchemaValidation's expression case if dropping expression support for queue is intentional — but as-is this is an unrelated regression bundled into a Codex-provider fix PR.
@copilot please address this.
| if githubProvider { | ||
| if features, ok := config.Overrides["features"].(map[string]any); ok { | ||
| if shellTool, exists := features["shell_tool"]; exists && shellTool != false { | ||
| return errors.New("engine.config: features.shell_tool is disabled for GitHub inference because the Copilot compatibility adapter does not support the Codex exec custom tool") |
There was a problem hiding this comment.
[/diagnosing-bugs] Root cause only partially addressed: validateCodexManagedConfig only blocks engine.config TOML overrides. But buildCodexCommand appends workflowData.EngineConfig.Args (customArgsParam) as the last segment of the generated codex exec ... command, after shellToolParam ( -c features.shell_tool=false). Since later -c flags win in Codex CLI arg parsing, a workflow with engine: {id: codex, args: ["-c", "features.shell_tool=true"]} silently re-enables the exec tool for GitHub inference, bypassing the new guard entirely.
💡 Suggested fix
Add a check (alongside/near validateCodexManagedConfig, or in buildCodexCommand) that scans workflowData.EngineConfig.Args for a features.shell_tool override when ResolveLLMProvider(workflowData) == LLMProviderGitHub, and rejects it the same way the TOML override is rejected. Add a regression test mirroring TestCodexGitHubInferenceRejectsExecToolOverride but using Args instead of Config.
@copilot please address this.
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Request changes
This still has two merge-blocking regressions: the schema change breaks previously valid concurrency.queue expressions, and the new Codex guard is bypassable because engine.args are appended after the generated shell_tool=false settings.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 48.5 AIC · ⌖ 6.99 AIC · ⊞ 19.4K
Comment /review to run again
There was a problem hiding this comment.
Impeccable-mode review (bug_fix → harden, audit)
Verified the two existing review findings by reproducing them locally:
-
Schema regression confirmed (
pkg/workflow/schemas/github-workflow.json:46): removing theexpressionSyntaxbranch fromconcurrency.queuebreaks the pre-existingTestConcurrencyQueueSchemaValidationtest:- at '/concurrency': 'oneOf' failed, none matched - at '/concurrency/queue': value must be one of 'single', 'max'This change is unrelated to the Codex exec-tool fix and silently drops support for
queue: ${{ ... }}expressions. It should be reverted (restore theoneOfwithexpressionSyntax) or split into its own PR. -
shell_toolguard bypass confirmed (pkg/workflow/codex_config.go:176):validateCodexManagedConfigonly inspectsconfig.Overrides["features"](TOMLengine.config).buildCodexCommand(pkg/workflow/codex_engine.go:345-349) appendsworkflowData.EngineConfig.Argsafter the generated-c features.shell_tool=falseflag with no validation, soengine: { id: codex, args: ["-c", "features.shell_tool=true"] }re-enables the unsupportedexectool for Copilot inference, defeating the whole safeguard this PR adds.
Both are genuine blocking issues (one is a regression test failure, the other defeats the PR's stated purpose for GitHub inference). Requesting changes.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 59.8 AIC · ⌖ 13 AIC · ⊞ 8.1K
|
🎉 This pull request is included in a new release. Release: |


Codex runs using the Copilot-compatible endpoint fail when Codex submits its unsupported
execcustom tool. Configure Codex to omit that tool for GitHub inference while preserving OpenAI behavior.features.shell_tool = false; overrides that re-enable it are rejected.