Skip to content

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

Closed
geunwoojun99 wants to merge 5 commits into
lidge-jun:devfrom
geunwoojun99:fix/jev-native-effort-upstream
Closed

geunwoojun99 wants to merge 5 commits into
lidge-jun:devfrom
geunwoojun99:fix/jev-native-effort-upstream

Conversation

@geunwoojun99

@geunwoojun99 geunwoojun99 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • [code read] Apply the existing validated initial JEV effort to opt-in native Chat dispatch, including explicit null. Provider pins/caps and wire normalization remain downstream; later targets rebuild the original request and do not ask the judge again.
  • [code read] Use non-force initial-null shaping on both lanes so a forced Combo default cannot turn a valid no-effort choice into an exception. Ordinary force-default validation is unchanged. Remove conflicting caller controls and retain applied-effort log transitions.
  • [code read] This is a behavioral follow-up to merged fix(jev): preserve applied effort transitions in combo logs #6663, not a duplicate: that PR intentionally left native wire effort unchanged. Update its mismatch assertions openly, add real-wire regressions across all three existing backends, and synchronize the guide/structure contracts. No new configuration or decision mode.

Verification

[executed] Current head: 72d5fc78e4a1522014c7b6c087fb2835ad016bab. Additively merged latest dev (68c9d354574ed240c17805493409f8c589682b91); no conflicts, history rewrite, or force push. The merge brings in unrelated upstream changes (170 files changed relative to the previous head); the PR's own diff against dev is still the same 16 files (+353/-37). Six of those 16 files (scripts/test-layout/layout.json, tests/fixtures/test-layout-expected.json, and four structure/ documents) also gained upstream entries in the merge; the other ten are byte-identical to the previous head.

[executed] Validation used checksum-verified Bun 1.4.0, an isolated clone at this exact head, private dependency copies verified with bun install --frozen-lockfile --ignore-scripts, synthetic homes/configuration, repository preload, and bounded commands. No shared dependencies or installed runtime were modified. Documentation dependencies were independently installed with the frozen lockfile.

[executed] All commands below passed. Focused wire/native/Combo regression selection: 131 pass / 0 fail, seven files (including the 42-case initial-effort wire regression). Adjacent JEV decision/provider/backend/log selection: 68 pass / 0 fail, four files. Layout/ratchet/structure/Core-Lab tests: 104 pass / 0 fail, five files. Counts describe separate selections, not full-suite coverage.

bun install --frozen-lockfile --ignore-scripts
bun --no-install run --bun typecheck
bun --no-install node_modules/typescript/bin/tsc --noEmit -p tests/tsconfig.doctor-service-memory-contract.json
bun --no-install node_modules/typescript/bin/tsc --ignoreConfig --noEmit --strict --target ESNext --module ESNext --moduleResolution bundler --types bun-types --skipLibCheck scripts/ci/docker-smoke.ts

bun --no-install test --no-orphans --preload ./tests/preload.ts --isolate --timeout=10000 \
  tests/responses/jev-initial-effort-wire.test.ts \
  tests/responses/chat-native-combo.test.ts \
  tests/server/combo-requested-effort.test.ts \
  tests/server/server-jev-combo-e2e.test.ts \
  tests/server/server-jev-model-decision-e2e.test.ts \
  tests/server/jev-decision-scope.test.ts \
  tests/adapters/openai/openai-chat-native-policy.test.ts

bun --no-install test --no-orphans --preload ./tests/preload.ts --isolate --timeout=10000 \
  tests/routing/jev-decision.test.ts \
  tests/routing/jev-decision-provider-combo.test.ts \
  tests/routing/jev-model-backend.test.ts \
  tests/usage/request-log-jev.test.ts

bun --no-install test --no-orphans --preload ./tests/preload.ts --isolate --timeout=10000 \
  tests/test-layout.test.ts tests/test-layout-tooling.test.ts \
  tests/ci-workflows/file-size-ratchet.test.ts \
  tests/ci-workflows/structure-ssot.test.ts tests/lab/core-lab-boundary.test.ts

bun --no-install run --bun structure:check
bun --no-install run --bun privacy:scan
bun --no-install scripts/file-size-ratchet.ts
git diff origin/dev --check
(cd docs-site && bun install --frozen-lockfile)
(cd docs-site && bun --no-install run --bun build)
# With checksum-verified Node 22.16.0 first on PATH:
(cd docs-site && bun --no-install run build)

[executed] The adjacent selection is exactly the four existing files listed above; the earlier non-existent tests/routing/jev-service-exchange.test.ts argument was dropped, and no exchange-test coverage is claimed. Production typecheck and both additional CI TypeScript compiler configurations passed using the locked compiler. Both Bun-hosted and supported-Node documentation builds passed: 569 pages / 79,215 internal links.

[not checked] Full bun run test and import-connected bun run test:changed were not run. Under the explicit AGENTS.md/CONTRIBUTING.md resource exception, focused real-wire regressions plus adjacent routing/logging and source-oracle guards were used: the checkout has over 2,000 tracked test files and this environment is shared with concurrent agent/runtime work. A full run is disproportionate for this two-production-file fix in that shared environment. Remaining coverage includes unrelated/import-connected regressions, full wrapper orchestration, and cross-platform execution; these remain for hosted CI, not claimed passing.

[executed] Review inspection found zero review threads, no actionable CodeRabbit findings, and 100% docstring coverage on 193b35db5e31f034deec6825ea1acfae8eca4df0 (CodeRabbit summary comment #6750 (comment)). CodeRabbit's summary comment covers a1dd3cd..72d5fc7: the recent review (after which CodeRabbit auto-paused reviews on this PR) reports no actionable comments, and 5/5 pre-merge checks passed, including docstring coverage 100%. The additive base-only refresh does not alter that feature diff (re-checked: same 16 files). All known correct findings are addressed. [not checked] Independent Codex approval is not claimed.

[code read] Readiness gate source treats local validation as an author attestation with the documented full-suite exception; recent-dev means at most ten behind; findings means no unresolved correct bot findings; the final box confirms review readiness. Hosted CI approval is not a prerequisite for these boxes, but successful required current-head CI remains mandatory before merge.

[executed] At the current head 72d5fc7, PR hygiene passed. Administrative gates re-run on each push and body edit, and some runs are cancelled and superseded; their live state is the source of truth, and no result is claimed for runs still queued. [not checked] Cross-platform CI and React Doctor report action_required awaiting workflow approval, not passing runtime validation, so no runtime-CI result is claimed. This is ready for review, not merge approval. No merge was performed.

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.

Review readiness checklist

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

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • Bug Fixes
    • Combo requests now apply the selected reasoning effort consistently across Responses and native Chat, including explicit choices to omit effort—even when the Combo has a forced default. Conflicting caller reasoning controls are removed before provider-specific settings and normalization are applied.
    • Request logs show when the applied effort differs from the requested effort and record subsequent adjustments.
    • Later fallback targets continue to use the Combo’s standard policy and original request, without making another JEV decision.

🤖 Generated with Claude Code

Apply the existing validated first JEV decision on the native lane and handle initial null without force-default exceptions. Preserve downstream pins, caps, ordinary force validation and original-request fallback policy.

Add wire regressions across the existing three backends and synchronize effort contracts. Extracted independently onto current dev without level-routing features.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: 3818d25f-ed4f-45dd-bb31-ecfcbbee84ef
📥 Commits

Reviewing files that changed from the base of the PR and between a1dd3cd and 72d5fc7.

📒 Files selected for processing (4)
  • scripts/test-layout/layout.json
  • structure/ops/service-and-sidecars.md
  • structure/subagents.md
  • tests/fixtures/test-layout-expected.json

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


📝 Walkthrough

Walkthrough

The initial JEV effort decision now applies to the first native Chat and Responses Combo children. Request shaping, effort labels, fallback behavior, tests, and documentation reflect this handling.

Changes

Initial JEV effort handling

Layer / File(s) Summary
Apply the initial decision to child requests
src/server/responses/core-combo-native.ts, src/server/responses/core-combo.ts, structure/providers/jev-decision.md, structure/transports/responses.md, docs-site/src/content/docs/guides/combos.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
The first native Chat dispatch applies the initial JEV effort or removes reasoning_effort when the decision is null. Responses child handling uses fallback mode for a null effort and force mode for a selected effort. Both lanes restore the requested effort from the initial decision. Documentation describes request shaping, provider adjustments, labels, and later-target behavior.
Test wire behavior and decision handling
tests/responses/chat-native-combo.test.ts, tests/responses/jev-initial-effort-wire.test.ts, scripts/test-layout/layout.json, tests/fixtures/test-layout-expected.json
Updated Combo tests expect the selected effort when unpinned and include provider-pin changes in effort labels. New tests cover both request lanes, all three JEV backends, request shaping, retries, invalid selections, cancellation, and spend-ledger settlement. The new test is assigned to the responses suite.

Priority: ➖ Normal

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Combo
  participant JEV
  participant ChildDispatch
  participant Provider
  Combo->>JEV: Request initial effort decision
  JEV-->>Combo: Return selected effort or null
  Combo->>ChildDispatch: Apply decision to first child request
  ChildDispatch->>Provider: Send shaped request
Loading

Possibly related PRs

  • lidge-jun/opencodex#6790: Continues the initial JEV effort handling changes and adds related fixes for duplicate effort-label segments and native-lane test coverage.

Merge Risk: ⚪ Minimal · up to 72d5f

Initial JEV effort, including null, is applied to the first child while downstream and later-target behavior remain intact. No actionable merge-blocking risk was found.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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 6 functions across 4 files. (4 skipped: 4 …
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: applying the initial JEV effort decision to native Chat dispatch.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 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

  • ⬜ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ⬜ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ⬜ 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.

@geunwoojun99

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@codex review

The PR intentionally remains draft while independent review and broad validation are pending.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Address the pre-merge docstring coverage warning without changing request behavior, test assertions, or review thresholds.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@geunwoojun99

Copy link
Copy Markdown
Contributor Author

Addressed the pre-merge docstring warning in 193b35d.

  • [executed] The latest review contained no inline findings, but its docstring check reported 16.67% coverage against an 80% threshold.
  • [code read] Added JSDoc to the native Combo lane factory and all four new wire-test helpers. This follow-up changes comments only; runtime behavior, test assertions, configuration and thresholds are unchanged.
  • [executed] Using the pinned 1.4.0 test runner with an isolated environment and repository preload: the wire regression file reports 42 pass / 0 fail. Production typecheck, privacy scan, file-size ratchet and diff whitespace checks passed.
  • [not checked] The full suite and import-connected wrapper were not rerun for this documentation-only follow-up. Existing broad-validation limitations still apply; this PR remains draft. The updated hosted docstring result is pending, not claimed passing.

@coderabbitai review

Please refresh the pre-merge docstring check for the new head.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@geunwoojun99
geunwoojun99 marked this pull request as ready for review October 8, 2026 08:40
Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions
github-actions Bot marked this pull request as draft October 9, 2026 05:52
lidge-jun added a commit that referenced this pull request Oct 9, 2026
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

Copy link
Copy Markdown
Owner

Thank you, @geunwoojun99! This change landed on dev through the maintainer carry #6790 (squash commit ed37977), which credits you with a Co-authored-by trailer. The carry applies the validated initial JEV effort to opt-in native Chat dispatch, merges repeated effort log labels, and adds a test that proves the native path ran. Closing this PR as superseded by #6790.

@lidge-jun lidge-jun closed this Oct 9, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants