Skip to content

fix(command-code): add v4.1-flash and Qwen3.8-Flash effort ladders - #4258

Closed
gitgarmin wants to merge 2 commits into
lidge-jun:devfrom
gitgarmin:codex/command-code-v41-qwen-efforts
Closed

fix(command-code): add v4.1-flash and Qwen3.8-Flash effort ladders#4258
gitgarmin wants to merge 2 commits into
lidge-jun:devfrom
gitgarmin:codex/command-code-v41-qwen-efforts

Conversation

@gitgarmin

@gitgarmin gitgarmin commented Sep 11, 2026

Copy link
Copy Markdown

Summary

  • deepseek/deepseek-v4.1-flash and Qwen/Qwen3.8-Flash are live-discovered command-code routes with no row in COMMAND_CODE_MODEL_EFFORTS. With no row, supportedCommandCodeEffort resolves to undefined, so the adapter omits reasoning_effort entirely: a client's max reaches /alpha/generate as no reasoning parameter at all, and neither preset advertises an effort control for the route.
  • This adds both rows, plus a regression test that pins the table lookup (including case folding), the ladder on both the OAuth and the API-key preset, and the value that survives request construction.

Evidence

Measured live on 2026-09-11 against this machine's running 2.50.0 proxy carrying the same rows, read from the proxy request log (requestedEffort / effectiveEffort / reasoningWireValue) and the upstream status:

Route Requested effort wire reasoning_effort before wire after Upstream
deepseek/deepseek-v4.1-flash max absent max HTTP 200
Qwen/Qwen3.8-Flash max absent max HTTP 200

Adapter-level probes on the same rows: max -> max, high -> high, xhigh -> max (the generic clamp), ultra -> stripped. No alias is claimed for ultra, because no profile evidence backs one the way it does for v4-pro/v4-flash.

Ladder provenance

Both ladders are inferred from the same-family rows already in the table (deepseek v4: high..max; the Qwen 3.8 family convention: low..max), not scraped from the profile pages: commandcode.ai renders those client-side with an empty reasoning payload, so refreshCommandCodeReasoningEfforts cannot self-correct these rows, exactly as the #2647 block above documents. The live 200s above are the evidence that upstream accepts these values; if a rung is ever rejected, the adapter already re-sends once without the field.

Verification

  • bun test tests/providers/command-code-provider.test.ts - 47 pass / 0 fail (includes the new test)
  • bun test tests/providers/commandcode-provider.test.ts - 8 pass / 0 fail
  • bun x tsc --noEmit - clean
  • bun run privacy:scan - clean
  • bun run test (full suite, macOS) - passes except tests/codex-integration/codex-shim.test.ts, one launcher-timing test that fails identically on the unmodified dev tip (18e553a5, same as this PR base) in this environment, so it is unrelated to this diff. (The runner parallel lane reports aborted: worker panicked for many files under full parallelism on this machine; its isolated re-run clears them.)

Checklist

  • Scope stays focused and avoids unrelated cleanup. Two files: the table rows and their test.
  • Docs or release notes were updated when needed. No doc enumerates per-route effort ladders; nothing to update.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. Static table plus test only; no auth, credential, or transport surface is touched.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features

    • Added support for the DeepSeek V4.1 Flash and Qwen3.8 Flash models.
    • Added model-specific reasoning effort options, including support for the max setting.
    • Requests using these models now forward the selected reasoning effort correctly.
  • Tests

    • Added coverage for model discovery, case-insensitive effort lookup, and request handling across authentication methods.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: caf1c70c-7b85-4769-bc2f-6f544bf302bc

📥 Commits

Reviewing files that changed from the base of the PR and between 18e553a and 857af82.

📒 Files selected for processing (2)
  • src/providers/command-code-efforts.ts
  • tests/providers/command-code-provider.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The provider adds reasoning-effort ladders for two Command Code models. Tests verify both authentication presets, case-insensitive lookup, and forwarding of the max effort in requests.

Changes

Command Code model reasoning efforts

Layer / File(s) Summary
Effort mappings and request validation
src/providers/command-code-efforts.ts, tests/providers/command-code-provider.test.ts
Adds deepseek/deepseek-v4.1-flash with high and max efforts and Qwen/Qwen3.8-Flash with low, medium, high, and max efforts. Tests verify both OAuth and API-key registries, case-insensitive lookup, and reasoning_effort: "max" request output.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 60f5b

The new models expose their intended reasoning controls and forward supported effort values correctly. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding effort ladders for the DeepSeek v4.1 Flash and Qwen3.8 Flash Command Code models. It matches the changes in src/providers/command-code…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ All CI tests are green on my local testing.
  • ⬜ I pushed my PR to the latest dev commit.
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

Hygiene

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 11, 2026
Both routes are live-discovered but had no row in the official effort table, so
supportedCommandCodeEffort resolved to undefined and the adapter omitted
reasoning_effort entirely: a client's `max` reached /alpha/generate as no reasoning
parameter at all, and neither preset advertised an effort control for them.

The ladders are inferred from the same-family rows (deepseek v4: high..max; the
Qwen 3.8 family: low..max). The profile pages render client-side with an empty
reasoning payload, so the self-refresh path stays dead for these rows exactly as
the lidge-jun#2647 block above documents. Measured live 2026-09-11 on 2.50.0:
/alpha/generate accepts reasoning_effort "max" on both routes (HTTP 200), while the
unpatched adapter stripped the field before the wire.

Tests: bun test tests/providers/command-code-provider.test.ts (47 pass),
bun test tests/providers/commandcode-provider.test.ts (8 pass), bun x tsc --noEmit
(clean), bun run privacy:scan (clean).
@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 61 / 80

이 PR은 Command Code 어댑터가 살아 있는 두 경로(deepseek/deepseek-v4.1-flash, Qwen/Qwen3.8-Flash)에 대해 공식 effort 표 COMMAND_CODE_MODEL_EFFORTS에 행이 없어서, supportedCommandCodeEffortundefined를 돌려 reasoning_effort를 통째로 빼 버리던 구멍을 막습니다. 지금 dev HEAD는 18e553a52이고, 방금 #4257이 Codex 쪽 max/ultra를 무조건 내보내고 낡은 clamp 진단을 만료시키는 레인으로 들어왔습니다. 이 PR은 그 Codex 카탈로그 레인과 파일도 안 겹칩니다. 손대는 곳은 src/providers/command-code-efforts.ts 표 두 행과 tests/providers/command-code-provider.test.ts 회귀 테스트뿐이라, hub 스택(#4250#4255)과도 독립입니다.

왜 중요한지 짧게 말하면, 클라이언트가 max를 골라도 와이어에는 reasoning 파라미터가 아예 안 실렸습니다. 프리셋(OAuth command-code, API-key commandcode)도 이 경로에 effort 컨트롤을 안 보여 줬습니다. 표에 행을 넣으면 조회가 살아나고, 요청 조립에서 reasoning_effort가 남습니다. PR 본문에 2026-09-11 라이브 측정이 있습니다. 같은 머신 2.50.0 프록시에서 두 경로 모두 max → 와이어 max, 업스트림 HTTP 200. high는 통과, xhigh는 일반 clamp로 max, ultra는 별칭 없이 strip. v4-pro/v4-flash에 있던 ultra→max 별칭은 여기엔 안 넣었다고 명시했습니다.

사다리는 프로필 페이지에서 긁은 게 아닙니다. commandcode.ai는 클라이언트 렌더라 reasoning 페이로드가 비어 있고, #2647 블록이 이미 적어 둔 대로 refreshCommandCodeReasoningEfforts가 이 행들을 스스로 고치지 못합니다. deepseek 쪽은 같은 표의 deepseek-v4-pro / deepseek-v4-flash가 쓰는 high..max를 그대로 옮겼고, Qwen 쪽은 표에 형제 Qwen3.8 행이 없어서 “Qwen 3.8 가족 관습” low..max를 추론했다고 적혀 있습니다. 업스트림이 거절하면 어댑터가 필드 없이 한 번 재전송하는 기존 안전망은 그대로입니다. 테스트는 OAuth/API-key 양쪽 프리셋 사다리, 대소문자 fold(qwen/qwen3.8-flash), builtRequest 후 바디의 params.reasoning_effort === "max"까지 고정합니다.

지금 dev와의 관계만 보면, 베이스가 merge 직전 tip인 42184ead0입니다. #4257이 들어간 뒤 tip은 18e553a52라서, ready 체크리스트의 “latest dev에 push”를 아직 안 맞춘 상태입니다. 충돌 가능성은 낮습니다. command-code 표와 Codex effort 파일은 다른 축입니다. 다만 draft이고 readiness 네 칸이 비어 있으며, CI는 enforce-target/hygiene/label만 돌고 CodeRabbit은 draft라 skip입니다. types.ts/config.ts 분할 캠페인과도 무관하고, 중복 PR로 보이는 열린 항목도 없습니다. 제품 버전선은 여전히 package.json 2.51.0입니다.

라인 - src/providers/command-code-efforts.ts deepseek/deepseek-v4.1-flash - 형제 v4-pro/v4-flash와 같은 ["high","max"]. medium/xhigh를 안 넣는 선택은 가족 행과 일치하지만, 클라이언트가 medium을 보내면 clamp/strip 동작이 형제와 같아야 함.
라인 - src/providers/command-code-efforts.ts Qwen/Qwen3.8-Flash - 표에 형제 Qwen3.8 행이 없어 low..max는 추론. 라이브 200은 max만 확인했고 medium/high 개별 200은 본문에 없음.
라인 - tests/providers/command-code-provider.test.ts 신규 테스트 - OAuth/API-key 양쪽 + case fold + wire 값까지 묶어 회귀를 잘 잡음. ultra strip / xhigh→max는 본문 주장만 있고 이 테스트엔 없음.
경로/심볼 - refreshCommandCodeReasoningEfforts / #2647 - 셀프 리프레시가 여전히 죽은 전제. 잘못된 사다리는 사람이 고칠 때까지 남음(기존 결함, 이번 PR이 새로 만든 건 아님).
경로/심볼 - 베이스 42184ead0 vs HEAD 18e553a52 - #4257 이후 tip에 재기반 필요. 파일 겹침은 없음.

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

  • Qwen3.8-Flash 사다리를 low..max로 둘지, deepseek처럼 더 좁히거나 medium/high 라이브 200을 한 번 더 보고 확정할지.
  • deepseek v4.1-flash에 v4-pro/v4-flash식 ultra→max 별칭을 일부러 안 넣은 정책을 이 경로에도 고정할지.
  • draft readiness(로컬 CI 전부 초록, latest dev rebase, CodeRabbit/Codex finding 정리)를 채운 뒤에만 ready로 올릴지, 표+테스트만으로 빨리 넣을지.

너의 추천
draft 유지한 채 latest dev(18e553a52, #4257 포함)에 rebase하고, readiness 체크리스트를 채운 뒤 ready로 전환해 merge. 범위가 작고 실측·테스트가 분명한 command-code 표 구멍 수라 #4257 Codex 레인과 안전하게 병행된다. Qwen medium/high 라이브 확인이 부담이면 코멘트로 “max 200만 확인, 거절 시 기존 strip 재전송”을 남기고 넣어도 된다. types/config split과 무관하고, 닫을 중복 PR도 없다.

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

@gitgarmin
gitgarmin force-pushed the codex/command-code-v41-qwen-efforts branch from 2417cee to 857af82 Compare September 11, 2026 05:36
@github-actions
github-actions Bot marked this pull request as ready for review September 11, 2026 05:38
@gitgarmin

Copy link
Copy Markdown
Author

Thanks for the review — quick updates, since it was written against head 42184ead0:

Rebase + readiness: rebased onto 18e553a52 (current dev tip, #4257 included) and completed the readiness checklist; the gate now shows READY.

Qwen3.8-Flash ladder — live confirmation (the open question): all four rungs were measured against the running 2.50.0 proxy on 2026-09-11 (POST /v1/responses/alpha/generate). Every rung returns HTTP 200 with the wire value preserved:

requested reasoning_effort on wire upstream
low low 200
medium medium 200
high high 200
max max 200 (previously reported)

So the full low..max ladder now has a live 200 per rung, not just max. If you'd still rather narrow it (drop low/medium), say so and I'll adjust the row and tests.

On the ultra → max alias for deepseek/deepseek-v4.1-flash: deliberately not added — the adapter strips ultra on this route today (no alias claimed, no profile evidence for one), matching the posture documented in the row comment. If you prefer the v4-pro/v4-flash family behavior, it's adding the id to the needsAlias list in supportedCommandCodeEffort plus one test assertion.

On pinning xhigh → max / ultra strip per-route in the test: both paths run through the same shared supportedCommandCodeEffort code the existing deepseek-v4-flash assertions already cover, which is why the new test focuses on the table rows themselves. Happy to add explicit v4.1-id assertions if you want them pinned per route before merge.

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Checked 857af82. The missing table row does explain why supportedCommandCodeEffort returns undefined and strips the requested effort; adding these two rows is a focused change, not a provider endpoint/auth expansion. Your new Qwen four-rung report improves on the earlier max-only observation.

Please update the in-code provenance to distinguish that new measured report from the remaining family inference; it still says only max was measured. Keep HTTP acceptance separate from proof that the upstream actually applies a distinct reasoning level. For deepseek-v4.1-flash, the high rung is still described as inferred, not independently measured.

Add the new exact-id builder assertions for xhigh -> max and ultra omission. The older v4-flash test is not an equivalent negative control: that id is in needsAlias and accepts ultra -> max, whereas this new id deliberately is not. Preserve that difference instead of expanding ultra support by analogy. Current hosted product/typecheck evidence remains separate from READY/intake checks. No live paid request or local provider setting was changed.

@lidge-jun lidge-jun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed against the current tree. The deepseek/deepseek-v4.1-flash row is well-founded and the mechanism is right: the table is the only effort source for Command Code (/provider/v1/models carries no effort contract), both presets share the same object (src/providers/registry.ts:1419 and :2307), and the lookup folds case (src/providers/command-code-efforts.ts:149-159). Dropping ultra is correct — it is absent from needsAlias (src/adapters/command-code.ts:497-500) so it would be stripped, and xhigh already clamps at :501-503.

Two things to fix, neither blocking the deepseek row.

1. The Qwen provenance comment cites a row that does not exist. The comment says the ladder is inferred from "the same-family rows above … the Qwen 3.8 family: low..max", but COMMAND_CODE_MODEL_EFFORTS has no Qwen row at all — deepseek/deepseek-v4.1-flash is the only new family member, and the fixture (tests/fixtures/commandcode-models.json) carries neither id. What the PR actually measured is max → HTTP 200. That supports max, and by the table's own convention high, but low and medium rest on nothing. Please either measure those two rungs or narrow the row to what was observed.

2. The "re-sends once without the field" claim in the description does not hold for these rows. src/adapters/command-code.ts:577-580 only retries when refreshed is defined, and the file's own comment at :24-37 documents that the profile parser is dead for client-rendered pages — which is exactly why these rows had to be hand-written. So a wrong rung is not a graceful degrade here; it is an upstream 400 on the request the user selected. That raises the cost of finding 1.

Everything else checks out: base is dev, no security surface, tests accompany the change, and the scope stays at two files. The oauth/api-key loop in the new test exercises one shared object rather than two, but that matches the existing GLM test above it, so it is not a new defect.

Merging on the maintainer path so the live routes stop losing their effort field. Finding 1 is tracked as follow-up — if the low/medium rungs turn out to be rejected upstream, narrowing the row is a one-line change.

@github-actions
github-actions Bot marked this pull request as draft September 11, 2026 12:55
@lidge-jun
lidge-jun marked this pull request as ready for review September 11, 2026 13:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 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-11T13:13:18.413178Z 60f5b37 Draft marked ready
ℹ️ 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.

@github-actions
github-actions Bot marked this pull request as draft September 11, 2026 13:09

@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: 60f5b370cc

ℹ️ 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 on lines +148 to +150
"deepseek/deepseek-v4.1-flash": {
efforts: ["high", "max"],
profileUrl: "https://commandcode.ai/models/deepseek-v4-1-flash",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update the owned structure documentation

These new provider effort contracts change runtime behavior under src/providers/, but the commit leaves every owning structure document unchanged; structure/INDEX.md maps this area to runtime.md, subagents.md, transports/inventory.md, and providers/xai-grok.md. Update the applicable source-of-truth documentation in this change, or narrow the ownership mapping if some listed documents do not actually own this contract.

AGENTS.md reference: AGENTS.md:L33-L41

Useful? React with 👍 / 👎.

lidge-jun added a commit that referenced this pull request Sep 11, 2026
…4282)

Splits the DeepSeek thinking set by who serves the route (first-party deepseek-flash vs gateway deepseek-v4.1-flash), removes the retired deepseek-v4-pro from every static roster, and excludes it from the routed catalog on live-discovery providers where deleting a row would strip capabilities instead of the model. Carries the Command Code effort ladders from #4258. Maintainer integration into dev per MAINTAINERS.md with all checks passing at the exact head.
@lidge-jun

Copy link
Copy Markdown
Owner

Landed — thank you, @gitgarmin. Both rows are on dev as of #4282, carried with your original commit and a Co-authored-by trailer so the contribution stays yours.

Why it went through a carry rather than a merge of this PR: updating this branch onto current dev (needed to clear an unrelated version-line gate that was failing test 1/4 and macos 1/2 on an older base) reset the contributor readiness checklist and moved the PR back to draft. That checklist includes an author attestation, and ticking it on your behalf is not something a maintainer should do — so the change was carried instead of holding it while the boxes were re-ticked.

The review findings still stand as follow-ups: the Qwen provenance comment cites a same-family row that does not exist in COMMAND_CODE_MODEL_EFFORTS, and only max was measured, so low/medium remain unproven. A wrong rung there is an upstream 400 rather than a graceful degrade, because src/adapters/command-code.ts:577-580 only retries when refreshed is defined.

@lidge-jun lidge-jun closed this Sep 11, 2026
@lidge-jun lidge-jun added the landed-via-maintainer Original PR closed after landing via a maintainer merge train label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working landed-via-maintainer Original PR closed after landing via a maintainer merge train

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants