Skip to content

fix(jev): apply initial effort to native Chat dispatch (carry #6750) - #6790

Merged
lidge-jun merged 1 commit into
devfrom
codex/jev-native-initial-effort-carry
Oct 9, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/jev-native-initial-effort-carry

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Carries #6750 by @geunwoojun99 onto current dev, with two small review fixes. The contributor's fork PR could not start hosted CI; this branch can.

Problem. With protocols.rollout.nativeChatCombos on, a JEV Combo's first native Chat dispatch ignored the judged effort. core-combo.ts called the native child without the validated decision and core-combo-native.ts applied the ordinary Combo effort instead, so the judge's choice (including an explicit "no effort") never reached the native wire.

Change (from #6750). The validated initial JEV decision now owns the first native Chat dispatch, including explicit null. Provider pins, caps and wire normalization still apply downstream; later failover targets rebuild from the original request and do not ask the judge again. Both lanes use non-force initial-null shaping, so a forced Combo default cannot turn a valid no-effort choice into an exception. The guide and the owning structure contracts are updated.

Review fixes added here.

  • comboRequestedEffortLabel collapses adjacent identical segments. With caller high, JEV low and a provider pin low, the log used to read high->low->low; it now reads high->low. New unit case in tests/server/combo-requested-effort.test.ts; the 17 existing cases are unchanged.
  • The 18-case initial-effort wire matrix now asserts that native cases actually ran on the native lane (protocolTrace.attempts[0].mode === "native"), so a bridge dispatch can no longer satisfy it.

Supersedes #6750 (left open for the maintainer to close with credit).

Co-authored-by: GeunwooJun 313474999+geunwoojun99@users.noreply.github.com

Verification

Local runs were kept to the changed behaviour (lane policy for this carry; the full suite is left to hosted CI):

Left to CI: the full cross-platform suite, docs build, and the remaining import-connected tests.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (No auth, credential or workflow changes.)

Summary by CodeRabbit

  • New Features
    • Initial JEV effort choices now apply to native Chat Combo requests as well as Responses requests. An explicit no-effort choice removes caller-specified effort, while provider settings can still adjust the final effort.
    • Request labels now reflect applied effort changes without repeating consecutive duplicate values.
  • Documentation
    • Clarified when native Chat requests omit caller effort and how initial JEV choices affect Combo requests.

Carry of #6750 onto current dev with review fixes.

A validated JEV choice now owns the first native Chat dispatch, including an
explicit no-effort choice; provider pins, caps and wire normalization still
apply downstream, and later targets do not ask the judge again.

Review fixes on top of the contributor's change:
- collapse adjacent identical segments in the Combo requested-effort label,
  so a provider pin that kept the JEV effort no longer logs high->low->low
- assert the native lane actually ran in the initial-effort wire matrix

Supersedes #6750

Co-authored-by: GeunwooJun <313474999+geunwoojun99@users.noreply.github.com>
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 9, 2026 01:45
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e3d07c0e-b083-4e84-835f-ed5706e8ac35
📥 Commits

Reviewing files that changed from the base of the PR and between c15037b and 2e234c1.

📒 Files selected for processing (18)
  • docs-site/src/content/docs/guides/combos.md
  • scripts/test-layout/layout.json
  • src/server/responses/combo-requested-effort.ts
  • src/server/responses/core-combo-native.ts
  • src/server/responses/core-combo.ts
  • structure/clients/claude-desktop.md
  • structure/dashboard-and-usage.md
  • structure/data-planes/images.md
  • structure/ops/service-and-sidecars.md
  • structure/providers/jev-decision.md
  • structure/providers/xai-grok.md
  • structure/subagents.md
  • structure/transports/responses.md
  • structure/transports/streaming-health.md
  • tests/fixtures/test-layout-expected.json
  • tests/responses/chat-native-combo.test.ts
  • tests/responses/jev-initial-effort-wire.test.ts
  • tests/server/combo-requested-effort.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The initial JEV effort decision now applies to both Responses and opt-in native Chat Combo children. Native Chat shaping handles explicit null effort and removes conflicting controls. Effort labels, tests, and documentation now reflect these behaviors and subsequent provider adjustments.

Changes

Initial JEV effort

Layer / File(s) Summary
Apply the initial effort to Combo children
src/server/responses/core-combo.ts, src/server/responses/core-combo-native.ts, src/server/responses/combo-requested-effort.ts, structure/providers/jev-decision.md, structure/transports/responses.md, structure/clients/claude-desktop.md, structure/dashboard-and-usage.md, structure/data-planes/images.md, structure/ops/service-and-sidecars.md, structure/providers/xai-grok.md, structure/subagents.md, structure/transports/streaming-health.md, docs-site/src/content/docs/guides/combos.md
The initial JEV decision is passed to native Chat children as well as Responses children. Native Chat shaping removes conflicting effort controls and caller service_tier; an explicit null choice removes the effort. The effort label removes consecutive duplicate segments. Documentation describes the behavior and later provider adjustments.
Verify effort dispatch and labels
tests/responses/jev-initial-effort-wire.test.ts, tests/responses/chat-native-combo.test.ts, tests/server/combo-requested-effort.test.ts, scripts/test-layout/layout.json, tests/fixtures/test-layout-expected.json
Tests cover effort selection, null choices, provider adjustments, retries, validation gates, cancellation, and spend-ledger settlements across both lanes. Existing effort-label assertions and test-layout mappings are updated.

Priority: ⬇️ Low

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant JEV
  participant ComboDispatch
  participant NativeChild
  participant ResponsesChild
  participant ProviderNormalization
  JEV->>ComboDispatch: initial effort decision
  ComboDispatch->>NativeChild: initial decision for native lane
  ComboDispatch->>ResponsesChild: selected effort for Responses lane
  NativeChild->>ProviderNormalization: shaped request body
  ResponsesChild->>ProviderNormalization: shaped request body
Loading

Merge Risk: ⚪ Minimal · up to 2e234

This change applies the initial effort decision to the first native Chat child, with matching tests and docs. No merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the primary change: applying the initial JEV effort to native Chat dispatch. The carry reference is relevant and does not obscure the change.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 6 files. (12 skipped: 1…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 github-actions Bot added the bug Something isn't working label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@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: 2e234c1dbd

ℹ️ 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 +232 to +233
if (initialDecision.effort === null) delete body.reasoning_effort;
else body.reasoning_effort = initialDecision.effort;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize initial JEV effort on the native wire

When native Chat is enabled and JEV selects an effort that has a provider wire alias—such as ultra, which must become max, or xhigh with reasoningEffortMap: { xhigh: "high" }—this assignment sends the semantic value directly. normalizePinnedChatEffort invokes mapReasoningEffort only after a pin or cap rewrite, while buildOpenAIChatPassthroughRequest deliberately preserves the remaining raw value, so an unpinned JEV choice can reach the provider unsupported and be rejected. Normalize this policy-produced effort before dispatch while retaining the semantic value for logging; the updated structure docs currently promise that wire normalization runs afterward.

AGENTS.md reference: structure/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

Comment on lines +912 to +913
// Both lanes applied the initial choice before provider pins/caps; retain those transitions.
restoreOriginalRequestedEffort(childLog, initialJevDecision?.effort);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve a pin transition after a null JEV choice

For a native request where JEV explicitly selects null and a downstream provider pin then supplies a different effort, this restoration drops the pin from both request and attempt labels. For example, caller low plus JEV null plus provider pin high sends high, but comboRequestedEffortLabel("low", "high", null) returns only low because a child label without -> is discarded when the forced effort is null. Record the newly introduced pinned base as a transition so the logs describe the actual wire behavior promised by the updated structure contract.

AGENTS.md reference: structure/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

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-10-09T01:48:17.948306Z 2e234c1 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.

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