Skip to content

fix(codex): size routed roles on the reasoning ladder Codex shows for them - #6761

Closed
LilMGenius wants to merge 1 commit into
lidge-jun:devfrom
LilMGenius:fix/role-auto-assign-effort-ladder
Closed

LilMGenius wants to merge 1 commit into
lidge-jun:devfrom
LilMGenius:fix/role-auto-assign-effort-ladder

Conversation

@LilMGenius

@LilMGenius LilMGenius commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Auto-assign maps each role's sized effort onto the reasoning ladder of the model it picks. It took that ladder only from the provider's catalog row (reasoningEfforts). A routed model whose row declares no levels got an empty ladder, so its proposal carried no effort, even though the catalog opencodex writes for Codex offers it low to ultra with medium as default.

Measured on 2.80.0 with ocx agent roles suggest --json: six of fourteen roles were proposed cpa/claude-sonnet-5-5, and all six had proposedEffort: null. Every role proposed a gpt-6-* model had one. opencodex-catalog.json lists supported_reasoning_levels low..ultra for those cpa/claude-* slugs.

Change

  • catalogModelLadders(slugs) in src/codex/catalog/effort.ts reads each slug's ladder and default from the written catalog. catalogModelEfforts now derives from it, with the same output as before.
  • modelCandidates in codex-role-auto-assign.ts falls back to that ladder and default when the row declares none. A row with its own levels keeps them.

The Subagents page's Suggest uses the same candidates, so its routed picks get an effort too.

Verification

  • New route test: a routed model with no declared levels takes the catalog's ladder (glance gives low, measured gives the catalog default medium). It fails on dev and passes with the change.
  • bun test tests/server/codex-role-auto-assign-routes.test.ts: 7 pass.
  • Every test file that imports the catalog effort helpers, the model rows, the effort policy, or delegation: 2137 pass. Four failures in that combined run (vision filter, vision reasoning contract, kiro adapter) pass when their files run alone, with or without this change.
  • bun x tsc --noEmit passes.

No GUI change.

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

  • New Features

    • Routed catalog models that omit reasoning levels can now use the catalog’s supported levels and default for proposal generation.
    • Catalog effort information now includes a model’s default effort when it is among the supported levels.
  • Tests

    • Added coverage for models with omitted reasoning levels and unrecognized sizing efforts.

… them

Auto-assign took a candidate's efforts from its provider row only. A routed model whose row declares
no levels (for example cpa/claude-*) got an empty ladder, so its proposal carried no effort even
though Codex's catalog offers low..ultra for it. The mapper now falls back to the written catalog's
ladder and default, the same source the Models page reads.
@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

✅ Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Oct 8, 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: 33a24381-3d2b-4766-baef-e4840f074c76
📥 Commits

Reviewing files that changed from the base of the PR and between 89cad95 and 38e5b27.

📒 Files selected for processing (4)
  • src/codex/catalog.ts
  • src/codex/catalog/effort.ts
  • src/server/management/codex-role-auto-assign.ts
  • tests/server/codex-role-auto-assign-routes.test.ts

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 catalog now exposes reasoning ladders with supported efforts and a validated default. Routed-model candidate selection uses that ladder when the model does not declare reasoning efforts.

Changes

Routed model effort fallback

Layer / File(s) Summary
Expose catalog reasoning ladders
src/codex/catalog/effort.ts, src/codex/catalog.ts
catalogModelLadders builds a map of catalog efforts and includes a default only when it is a string in the effort list. catalogModelEfforts derives its results from the ladder lookup. The catalog facade re-exports the new API. (effort.ts:89–96, 110–122; catalog.ts:7)
Use catalog ladders for routed candidates
src/server/management/codex-role-auto-assign.ts, tests/server/codex-role-auto-assign-routes.test.ts
When declared reasoning efforts are empty or absent, modelCandidates uses the catalog efforts and default. A nonempty declared list and its declared default remain authoritative. The test covers selecting low and falling back to the catalog default, medium. (codex-role-auto-assign.ts:61–77; test:104–129)

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant RoutedModel
  participant modelCandidates
  participant catalogModelLadders
  participant ProposalGeneration
  RoutedModel->>modelCandidates: provide declared reasoning efforts
  modelCandidates->>catalogModelLadders: look up catalog ladder when efforts are empty
  catalogModelLadders-->>modelCandidates: return supported efforts and valid default
  modelCandidates->>ProposalGeneration: provide candidate efforts and default
Loading

Merge Risk: ⚪ Minimal · up to 38e5b

The routed-model effort fallback appears ready to merge after normal checks; no unresolved issue is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 accurately summarizes the main change: routed Codex roles now use the reasoning ladder that Codex exposes for the selected models. It is specific, concise, and directly related to the catalo…
  • Fix all pre-merge checks with AI
✨ 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

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

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.

✅ 4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers: @lidge-jun @Ingwannu

@github-actions
github-actions Bot marked this pull request as draft October 8, 2026 12:05
@github-actions
github-actions Bot marked this pull request as ready for review October 8, 2026 12:08
lidge-jun added a commit that referenced this pull request Oct 9, 2026
…effort ladder, omo tab) (#6785)

* fix(codex): mirror LazyCodex role models into the [codex] section omo reads

LazyCodex reads per-role overrides from `[codex].agents` in ~/.omo/omo.jsonc. The mirror wrote a bare
`codex` key, which LazyCodex's strict config loader drops as unknown, so a role picked in the
dashboard reverted to the old model on the next LazyCodex install.

* docs(codex): name the [codex] section in the omo.jsonc mirror docs and messages

* test(codex): seed the role route tests with the [codex] section

The fixtures still wrote a bare "codex" block, which passed only because the writer creates the
section it needs. They now start from the shape LazyCodex reads.

* fix(codex): size routed roles on the reasoning ladder Codex shows for them

Auto-assign took a candidate's efforts from its provider row only. A routed model whose row declares
no levels (for example cpa/claude-*) got an empty ladder, so its proposal carried no effort even
though Codex's catalog offers low..ultra for it. The mapper now falls back to the written catalog's
ladder and default, the same source the Models page reads.

* feat(gui): show the LazyCodex role models on the omo tab

The section manages omo's Codex variant, so it sits with the other omo controls. It still renders
only when LazyCodex is detected, so a Pi-based omo install sees the tab unchanged.

* fix(gui): set the LazyCodex section apart from the Pi-based omo block

On the omo tab the section's heading ran straight on from the Pi restore center and read as part of
it. A rule and spacing now separate the two variants.

* test(gui): pin the LazyCodex section to the omo tab and to a detected install

* fix(codex): keep the shown default and an explicit empty ladder when sizing routed roles

A routed row that declares its own ladder but no default now keeps the default
the written Codex catalog shows, when that rung is on the ladder, instead of
falling back to the middle rung. An explicit empty reasoningEfforts declares no
effort control and no longer borrows the written ladder. Documents the fallback
in the auto-assign contract.

Co-authored-by: LilMGenius <[email protected]>

* docs(devlog): plan the LazyCodex role carry (#6760, #6761, #6762)

* test(gui): wait on the LazyCodex roles answer instead of a fixed delay

The omo-tab placement test checked the section 30 ms after mounting, so a
slow runner could pass the absence checks before the roles request landed or
fail the presence check before React rendered. Each step now waits for the
state it asserts: the roles answer for the undetected case, the rendered row
for the detected case, the panel for the Codex tab.

Co-authored-by: LilMGenius <[email protected]>

* test(gui): check LazyCodex section placement from a seeded store

The omo-tab placement test waited on timing and asserted absence with
toBeNull(), which under happy-dom also accepts an HTMLElement, so its absence
checks could not fail. It now seeds the role list's store, so the active tab's
copy of the section renders in the first commit, and compares the list of
panels that carry it: none for a Pi-based omo install, only the omo panel
when LazyCodex is detected, none with the Codex tab active. Placing the section
on the Codex tab, alone or alongside the omo tab, fails the test.

Co-authored-by: LilMGenius <[email protected]>

---------

Co-authored-by: LilMGenius <[email protected]>
@lidge-jun

Copy link
Copy Markdown
Owner

Thank you, @LilMGenius! This change landed on dev through the maintainer carry #6785 (squash commit fd20320), together with #6760, #6761 and #6762. Your original commits were kept in the carry, and the squash commit credits you with a Co-authored-by trailer. Closing this PR as superseded by #6785.

@lidge-jun lidge-jun closed this Oct 9, 2026
@LilMGenius
LilMGenius deleted the fix/role-auto-assign-effort-ladder branch October 25, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants