Skip to content

Remove implicit Codex model fallback from generated workflows - #66708

Merged
pelikhan merged 6 commits into
mainfrom
copilot/remove-default-model-for-codex-again
Oct 8, 2026
Merged

pelikhan merged 6 commits into
mainfrom
copilot/remove-default-model-for-codex-again

Conversation

Copilot AI commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex model fallback expressions included a terminal default, allowing a failed BYOK poison-sentinel primary to fall through to an unsanctioned model.

  • Compiler: Codex agent, detection, and evals expressions now use only phase-specific and enterprise model variables. If neither is set, model selection remains with the runtime.
  • Generated output: Updated the affected lock files and Codex golden fixture. Added coverage for a poison-sentinel primary across all three phases.

For example, the generated fallback now ends at the configured variables:

GH_AW_MODEL_FALLBACK: ${{ vars.GH_AW_MODEL_DETECTION_CODEX || vars.GH_AW_DEFAULT_MODEL_CODEX }}

Copilot AI linked an issue Oct 7, 2026 that may be closed by this pull request
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove default model for codex fallback chains Remove implicit Codex model fallback from generated workflows Oct 8, 2026
Copilot AI requested a review from pelikhan October 8, 2026 00:07
@pelikhan
pelikhan marked this pull request as ready for review October 8, 2026 00:57
Copilot AI balanced review requested due to automatic review settings October 8, 2026 00:57
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #66708

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed for PR #66708: no 'implementation' label (has_implementation_label=false) and only 30 added lines in business logic directories (threshold 100, requires_adr_by_default_volume=false).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation consistently removes terminal Codex fallbacks and includes focused coverage for all affected phases.

0 open findings

What changed in this PR

Removes Codex’s implicit terminal model fallback, addressing #63067 while preserving runtime model selection.

Changes:

  • Adds fallback expressions limited to phase and enterprise variables.
  • Applies them across agent, detection, evals, and metadata generation.
  • Updates tests, golden output, and generated workflows.
File Description
pkg/​workflow/​compilerenv/​manager.go Adds the no-terminal-fallback expression helper.
pkg/​workflow/​compilerenv/​manager_test.go Tests the new helper.
pkg/​workflow/​codex_engine.go Removes Codex’s built-in fallback.
pkg/​workflow/​codex_engine_test.go Updates phase-specific expectations.
pkg/​workflow/​evals_steps.go Removes the Codex evals fallback.
pkg/​workflow/​compiler_yaml_step_lifecycle.go Updates Codex model metadata generation.
pkg/​workflow/​model_env_vars_test.go Updates generated environment assertions.
pkg/​workflow/​engine_fallback_models_test.go Covers poison-sentinel behavior across phases.
pkg/​workflow/​testdata/​TestWasmGolden_AllEngines/​codex.golden Refreshes Codex golden output.
.github/​workflows/​smoke-codex.lock.yml Regenerates the Codex smoke workflow.
.github/​workflows/​engine-conformance-codex.lock.yml Regenerates the Codex conformance workflow.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request changes

The new Codex helper can surface unresolved ${{ vars... }} strings at runtime when neither model variable is defined, which existing runtime code treats as a hard configuration error.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 61.9 AIC · ⌖ 5.41 AIC · ⊞ 19.3K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd (via pr-triage: bug_fix). This is a tight, well-scoped fix — no actionable issues found.

📋 Analysis

Diagnosing-bugs check

  • Root cause (terminal || 'gpt-5.4' style fallback in BuildModelOverrideExpression) is addressed directly, not just the symptom, by introducing BuildModelOverrideExpressionWithoutFallback and routing all Codex call sites through it.
  • constants.CodexDefaultModel is already "", so require.Empty(t, constants.CodexDefaultModel) in engine_fallback_models_test.go correctly pins the precondition.
  • Verified no remaining call sites reference the old BuildModelOverrideExpressionEmptyFallback name or the removed built-in fallback constant in non-test code.

TDD check

  • TestCodexHasNoImplicitFallbackModel was expanded to table-drive all three phases (agent/detection/evals) with a POISON_PRIMARY sentinel and asserts the exact resulting expression — good regression coverage per /tdd's edge-case guidance.
  • Golden fixture (codex.golden) and both affected lock files were regenerated consistently with the new expression format; spot-checked engine-conformance-codex.lock.yml and smoke-codex.lock.yml — both correctly drop the || '' terminal.
  • Docs (docs/src/content/docs/reference/engines.md) already describe the "no implicit recovery model" behavior accurately; no doc update needed.

Positive highlights

  • ✅ Clear, descriptive rename (BuildModelOverrideExpressionWithoutFallback) with a doc comment explaining intent.
  • ✅ Test coverage spans all three Codex phases, not just the agent phase.
  • ✅ Minimal, surgical diff — no unrelated changes.

No blocking issues identified; approving.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 56.9 AIC · ⌖ 14.3 AIC · ⊞ 10.1K
Comment /matt to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Impeccable review (harden) — Remove implicit Codex model fallback

Reviewed via harden mode (bug-fix/behavior-removal change touching generated YAML env expressions).

Findings: No blocking issues on changed lines.

  • The rename BuildModelOverrideExpressionEmptyFallback → BuildModelOverrideExpressionWithoutFallback and its new behavior (${{ vars.X || vars.Y }} with no terminal '' fallback) is applied consistently across codex_engine.go, evals_steps.go, and compiler_yaml_step_lifecycle.go.
  • All affected generated lock files, the Codex golden fixture, and unit tests (TestCodexHasNoImplicitFallbackModel, TestBuildModelOverrideExpression, TestModelEnvVarInjection*, TestExpressionModelUsesEnvVar, TestCodexEngineExecutionPassesModelEnvVarIntoAWFStep) were updated and pass locally.
  • Dropping the trailing || '' is safe: GitHub Actions ${{ vars.X || vars.Y }} already evaluates to an empty string when both vars are unset, so behavior at the YAML-expression boundary is unchanged.

Non-blocking note (not part of this diff, no inline comment added): docs/adr/35286-compiler-managed-enterprise-env-controls.md (lines ~17, 67) still references the removed BuildModelOverrideExpressionEmptyFallback name. Worth a quick follow-up doc update so the ADR doesn't drift from the renamed/re-semantic'd helper, but this doesn't block merge.

No other UX/error-state/edge-case gaps identified in the diff.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 32.9 AIC · ⌖ 13.1 AIC · ⊞ 8.1K

@github-actions github-actions Bot mentioned this pull request Oct 8, 2026
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check conclusion (FAILURE): https://github.com/github/gh-aw/actions/runs/37710425606/job/113097743869.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: 6f5f3c7
Sous-chef work: 51e2287c3d1ee41b7e13769862add61dcd292a623cf943abc5968c984e246bcf
Sous-chef state: f49e620b5e31c208bb96f75d285b917e556e268a52842e97c1d51a1c88394c17

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 3.58 AIC · ⌖ 8.65 AIC · ⊞ 1K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits October 8, 2026 01:49
…t-model-for-codex-again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Request changes

The new Codex helper can surface unresolved ${{ vars... }} strings at runtime when neither model variable is defined, which existing runtime code treats as a hard configuration ...

Addressed in 12d7347: Codex model expressions now use an explicit || '' fallback when both configured variables are unset, while preserving runtime model selection. Regression tests and generated output are updated.

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Merged latest main and addressed the failing conclusion finding in 12d7347. Codex expressions now fall through only to '' when both configured variables are unset; regression tests and generated outputs are updated. Local validation passed; CI was not retriggered as requested.

Copilot AI requested a review from gh-aw-bot October 8, 2026 02:08
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check impacted-go-tests (FAILURE): https://github.com/github/gh-aw/actions/runs/37716070618/job/113117392711.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: 12d7347
Sous-chef work: 42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac
Sous-chef state: d3999a3372296ba7717438f5817171fa73c1885959d8d8ff53b756916c956e12

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 9.71 AIC · ⌖ 18.9 AIC · ⊞ 1K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits October 8, 2026 02:51
…t-model-for-codex-again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Merged the latest main and fixed the impacted tests by updating Codex fallback and current action-pin expectations. make fmt, make lint, make test-impacted-go, and make agent-report-progress passed. Pushed as eedad72; CI was not retriggered.

@pelikhan
pelikhan merged commit 23403d9 into main Oct 8, 2026
25 checks passed
@pelikhan
pelikhan deleted the copilot/remove-default-model-for-codex-again branch October 8, 2026 03:21
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.91.6

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.

model fallback chains default to 'gpt-5.4'

4 participants