Skip to content

[Feature]: Adaptive reasoning effort policy for mixed-capability combos and tool-bearing requests #2731

Closed

Description

@tone-leh

What are you trying to accomplish?

I need an OpenAI-compatible combo that mixes models with different reasoning-effort capabilities to expose a usable shared effort picker without sending an incompatible effort parameter to targets that cannot accept it.

Concretely, a combo should be able to include:

  • a model that accepts reasoning effort both with and without tools;
  • a model that accepts reasoning effort on plain text requests, but must omit the effort parameter when the request includes tools;
  • a model that intentionally exposes no effort control.

What prevents this today?

Two capability shapes cannot currently be represented together:

  1. The Chat Completions bridge can declare per-model supported efforts, but it does not support the request-level compatibility rule "omit effort only when tools are present".
  2. Combo catalog derivation intersects every known target ladder. An explicitly empty ladder means "no effort control" and participates in that intersection, so one no-effort target can make the whole combo picker empty even when other targets support the same four rungs.

Keeping the provider-wide ladder empty avoids upstream errors, but it also hides reasoning controls for models that genuinely support them.

What should OpenCodex do?

Add a per-model compatibility flag for OpenAI Chat providers so a model can expose supported efforts while omitting the wire effort field when the request includes tools.

Add an opt-in combo reasoning effort mode with these semantics:

  • default strict keeps the current intersection behavior unchanged;
  • adaptive derives the public combo ladder from targets that expose non-empty effort control;
  • targets with an explicit empty ladder remain supported as no-effort-control targets;
  • per-concrete-target request conversion preserves the selected effort only for targets that support it, and omits it for targets that intentionally expose no effort control;
  • the new per-model tools-compatibility flag omits the wire effort field whenever tools are present;
  • combo target order and failover behavior remain unchanged.

Example usage or interface

Provider configuration:

{
  "providers": {
    "custom-openai-chat": {
      "type": "openai-chat",
      "modelReasoningEfforts": {
        "model-a": ["low", "medium", "high", "xhigh"],
        "model-b": ["low", "medium", "high", "xhigh"]
      },
      "omitReasoningEffortWithToolsModels": ["model-b"]
    }
  }
}

Expected request behavior:

model-a + tools + reasoning effort high
  -> send reasoning_effort=high

model-b + no tools + reasoning effort high
  -> send reasoning_effort=high

model-b + tools + reasoning effort high
  -> omit reasoning_effort and let the upstream model default apply

Combo configuration:

{
  "combos": {
    "mixed": {
      "targets": [
        { "provider": "custom-openai-chat", "model": "model-a" },
        { "provider": "custom-openai-chat", "model": "model-b" },
        { "provider": "no-effort-provider", "model": "model-c" }
      ],
      "defaultEffort": "medium",
      "reasoningEffortMode": "adaptive"
    }
  }
}

Expected catalog behavior:

strict  -> current all-known-target intersection (unchanged)
adaptive -> [low, medium, high, xhigh] from non-empty target ladders

Expected adaptive failover behavior:

model-a target -> selected effort is sent
model-b target without tools -> selected effort is sent
model-b target with tools -> selected effort is omitted
model-c no-effort target -> selected effort is omitted

Alternatives or workarounds

Current workarounds are either too weak or unsafe:

  • Set an empty provider-wide ladder. This prevents upstream errors, but hides effort controls for models that support them and makes the combo picker empty.
  • Advertise a full ladder for every model. This makes tool-bearing requests to incompatible models fail deterministically instead of adapting.
  • Manually route around incompatible models. This loses ordered combo failover.
  • Retry the deterministic 400. Retrying cannot repair an invalid tools + effort parameter combination; the request must be constructed differently.

Additional context

This is related to, but narrower than, previous routed-effort propagation issues:

This proposal covers a different gap: per-model effort compatibility that depends on whether tools are present, plus an opt-in combo policy for mixed-capability targets.

No secrets or personal data are included. Provider names and model IDs above are synthetic examples. The compatibility evidence should be covered by deterministic local request-construction tests rather than by logging raw upstream traffic.

Activity

  1. added
    enhancementNew feature or request
    providerProvider adapters, OpenAI-compat presets, upstream API quirks
    on Aug 27, 2026
  2. lidge-jun commented on Aug 27, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 58 / 80

    이 이슈가 말하는 문제는 두 겹입니다. 첫째, openai-chat 브리지는 모델마다 지원 effort 목록은 적을 수 있지만, "도구가 있을 때만 effort를 빼라"는 요청 단위 규칙을 표현할 수 없습니다. 둘째, 콤보 카탈로그는 알려진 타깃 사다리를 모두 교집합하는데, 의도적으로 빈 사다리(노력 조절 없음)도 그 교집합에 들어가서, 한 타깃만 노력 없음이어도 콤보 피커 전체가 비어 버립니다. 지금 dev(HEAD 06fa6801d)의 deriveComboCatalogModel과 openai-chat 어댑터를 보면 그 설명이 맞습니다. 빈 provider-wide 사다리로 올리면 업스트림 400은 막히지만, 노력 조절이 되는 형제 모델의 UI도 같이 사라집니다.

    이슈 본문 - 필요한 설정 이름(omitReasoningEffortWithToolsModels, reasoningEffortMode: adaptive)과 기대 요청/카탈로그 표가 구체적입니다. 재현·대안도 짧고 명확합니다.
    관련 이슈 - #1100 / #1870 / #2688과 겹치지 않고, "도구 유무에 따른 호환 + 혼합 능력 콤보"라는 더 좁은 구멍을 가리킵니다.
    구현 PR - 같은 작성자의 draft #2734가 이 이슈를 Closes #2731로 이미 구현 중입니다. 문서·스키마·어댑터·카탈로그·관리 API·테스트가 들어 있습니다.

    메인테이너의 판단이 필요한 지점

    • 기본값을 strict로 두고 adaptive만 켜게 한 설계는 호환에 안전합니다. 이 방향을 공식으로 받아들일지 확인만 하면 됩니다.
    • adaptive를 켠 콤보에서 "빈 사다리만 모인 경우" 피커가 비는 동작은 문서에 남아 있어야 합니다.

    너의 추천
    이슈는 열어 두고, draft #2734 체크리스트가 끝난 뒤 그 PR을 머지해 닫으세요. 지금 이슈만 따로 닫거나 라벨을 바꾸지 마세요. #2734가 막히면 그때 다시 설계를 쪼개면 됩니다.

    이 댓글은 grok-bot이 작성했습니다

  3. lidge-jun commented on Sep 1, 2026

    @lidge-jun
    Owner

    Landed on origin/dev as 88c4275 via #3190. GitHub does not auto-close issues from a non-default target.

  4. github-actions commented on Sep 1, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestproviderProvider adapters, OpenAI-compat presets, upstream API quirks

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions