Skip to content

fix(combo): apply the combo default effort the target can actually reach - #3172

Merged
lidge-jun merged 1 commit into
devfrom
codex/3108-combo-default-effort
Sep 1, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/3108-combo-default-effort

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

A combo with a default reasoning level of max routed to deepseek-v4-pro sent none, while selecting the same model directly with max sent max.

concreteComboRequestBody tested literal membership — targetReasoningEfforts?.includes(defaultEffort) — and dropped the default on a miss. With nothing on the wire the provider's own default applied, which reads as none.

The catalog never agreed with that. effectiveComboDefault (src/codex/catalog/aggregation.ts) resolves a combo's advertised default to the highest supported rung at or below the request rather than dropping it, so the served catalog promised max for a combo whose requests were silently carrying no effort at all.

The fix is one shared resolver instead of two disagreeing rules. resolveEffortAtOrBelow moves into src/reasoning-effort.ts and both planes call it.

Why that file. The obvious move — importing effectiveComboDefault straight from aggregation.ts — is not available. aggregation.ts already imports src/combos, so the reverse import closes a cycle; and it pulls node:child_process, src/oauth, src/codex/model-cache, and src/adapters/cursor/live-models, all of which would land on the request path through src/server/responses/core.ts → src/combos. reasoning-effort.ts is a genuine leaf (its only import is ./types) and already owns codexEffortRank, the exact primitive the resolver needs.

Two behaviors deliberately do not change: an unknown ladder (undefined) stays fail-closed, and an explicitly empty ladder still means the model takes no reasoning effort.

Closes #3108.

Verification

Exact head 86dddcf5b:

  • bun test tests/combos.test.ts — 44 pass, 0 fail, 229 expect() calls.
  • bun test tests/core-lab-boundary.test.ts tests/combo-management-api.test.ts — 45 pass, 0 fail. The boundary suite is the one that would catch the import mistake described above.
  • bun test tests/codex-catalog.test.ts — 255 pass, 0 fail, confirming the catalog plane behaves identically after effectiveComboDefault became a delegation.
  • Red-green verified. Restoring the old includes() check turns the new case red (43 pass / 1 fail) and the fix returns it to green.

One existing assertion changed rather than being added to: concreteComboRequestBody(..., "high", ["low", "medium"]) previously expected undefined. That assertion was pinning the defect — it is the exact shape #3108 reports — so it now expects { effort: "medium" }. The unset, empty-ladder, and unknown-ladder cases in that test are untouched.

Full-suite and typecheck coverage is left to CI on this exact head.

Checklist

  • Targets dev
  • Focused regression added next to the existing combo request-cloning tests
  • Import boundary checked explicitly; tests/core-lab-boundary.test.ts green
  • No credential, auth, workflow, or release-automation surface touched
  • No config or schema change; no new dependency

Summary by CodeRabbit

  • New Features

    • Combo reasoning defaults now resolve to the closest supported effort level.
    • Higher requested levels are safely downgraded rather than omitted or exceeding available capabilities.
    • Exact matches and caller-supplied reasoning preferences continue to be honored.
  • Bug Fixes

    • Improved handling of partial reasoning settings and unsupported effort ladders.
    • Requests now retain a valid reasoning level whenever one can be resolved.

A combo configured for max routed to a target whose ladder tops out lower sent no
effort at all: concreteComboRequestBody tested literal membership and dropped the
default on a miss, so the provider default applied and the turn ran at none.

The catalog never agreed with that. effectiveComboDefault advertises the highest
supported rung at or below the request, so the served catalog promised max while
the request path silently sent nothing.

Share one resolver instead. It moves to src/reasoning-effort.ts, a leaf whose only
import is ./types and which already owns codexEffortRank, so the request path can
use it without importing the catalog plane - aggregation.ts pulls node:child_process,
oauth, model-cache and cursor live-models, and it already imports src/combos, so a
direct import would also have closed a cycle.

Unknown ladders stay fail-closed and an explicitly empty ladder still means no
reasoning. Neither behavior changes.

Closes #3108
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 1, 2026 16:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 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-09-01T16:38:56.265559Z 86dddcf PR opened
ℹ️ 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.

@lidge-jun
lidge-jun merged commit 7386b52 into dev Sep 1, 2026
6 of 7 checks passed
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@lidge-jun
lidge-jun deleted the codex/3108-combo-default-effort branch September 1, 2026 16:36
@github-actions github-actions Bot added the bug Something isn't working label Sep 1, 2026
@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 727d5623-7d35-4613-ba0c-ed759125476d

📥 Commits

Reviewing files that changed from the base of the PR and between e92aa33 and 86dddcf.

📒 Files selected for processing (4)
  • src/codex/catalog/aggregation.ts
  • src/combos/request.ts
  • src/reasoning-effort.ts
  • tests/combos.test.ts

📝 Walkthrough

Walkthrough

The change adds shared reasoning-effort resolution. Combo defaults now select the highest supported tier at or below the request and pass the resolved tier into target requests. Tests cover fallback, exact matches, caller overrides, and partial reasoning objects.

Changes

Combo reasoning effort

Layer / File(s) Summary
Shared effort resolution
src/reasoning-effort.ts
Adds resolveEffortAtOrBelow for exact matches, lower supported tiers, lowest-tier fallback, and unrankable inputs.
Combo integration and validation
src/codex/catalog/aggregation.ts, src/combos/request.ts, tests/combos.test.ts
Uses the shared resolver for catalog defaults and request construction. Resolved efforts are merged into requests. Tests cover fallback behavior, caller overrides, and unsupported ladders.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ComboCaller
  participant concreteComboRequestBody
  participant resolveEffortAtOrBelow
  participant TargetModel
  ComboCaller->>concreteComboRequestBody: submit request with optional effort
  concreteComboRequestBody->>resolveEffortAtOrBelow: resolve combo default against target tiers
  resolveEffortAtOrBelow-->>concreteComboRequestBody: supported effort
  concreteComboRequestBody->>TargetModel: send reasoning effort
Loading

Suggested reviewers: ingwannu

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/3108-combo-default-effort

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

lidge-jun added a commit that referenced this pull request Sep 1, 2026
…ated (#3175)

The case expected the first target to receive no reasoning_effort, which is the
behavior #3172 removed. That combo's members advertise low and low+high, so the
catalog advertises low, and low is now what the first target receives.

Refs #3108

Co-authored-by: jun <jun@lidge.dev>
tarunravi pushed a commit to tarunravi/opencodex that referenced this pull request Sep 14, 2026
…ach (lidge-jun#3172)

A combo configured for max routed to a target whose ladder tops out lower sent no
effort at all: concreteComboRequestBody tested literal membership and dropped the
default on a miss, so the provider default applied and the turn ran at none.

The catalog never agreed with that. effectiveComboDefault advertises the highest
supported rung at or below the request, so the served catalog promised max while
the request path silently sent nothing.

Share one resolver instead. It moves to src/reasoning-effort.ts, a leaf whose only
import is ./types and which already owns codexEffortRank, so the request path can
use it without importing the catalog plane - aggregation.ts pulls node:child_process,
oauth, model-cache and cursor live-models, and it already imports src/combos, so a
direct import would also have closed a cycle.

Unknown ladders stay fail-closed and an explicitly empty ladder still means no
reasoning. Neither behavior changes.

Closes lidge-jun#3108

Co-authored-by: jun <jun@lidge.dev>
tarunravi pushed a commit to tarunravi/opencodex that referenced this pull request Sep 14, 2026
…ated (lidge-jun#3175)

The case expected the first target to receive no reasoning_effort, which is the
behavior lidge-jun#3172 removed. That combo's members advertise low and low+high, so the
catalog advertises low, and low is now what the first target receives.

Refs lidge-jun#3108

Co-authored-by: jun <jun@lidge.dev>
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
…ach (lidge-jun#3172)

A combo configured for max routed to a target whose ladder tops out lower sent no
effort at all: concreteComboRequestBody tested literal membership and dropped the
default on a miss, so the provider default applied and the turn ran at none.

The catalog never agreed with that. effectiveComboDefault advertises the highest
supported rung at or below the request, so the served catalog promised max while
the request path silently sent nothing.

Share one resolver instead. It moves to src/reasoning-effort.ts, a leaf whose only
import is ./types and which already owns codexEffortRank, so the request path can
use it without importing the catalog plane - aggregation.ts pulls node:child_process,
oauth, model-cache and cursor live-models, and it already imports src/combos, so a
direct import would also have closed a cycle.

Unknown ladders stay fail-closed and an explicitly empty ladder still means no
reasoning. Neither behavior changes.

Closes lidge-jun#3108

Co-authored-by: jun <jun@lidge.dev>
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
…ated (lidge-jun#3175)

The case expected the first target to receive no reasoning_effort, which is the
behavior lidge-jun#3172 removed. That combo's members advertise low and low+high, so the
catalog advertises low, and low is now what the first target receives.

Refs lidge-jun#3108

Co-authored-by: jun <jun@lidge.dev>
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.

1 participant