Skip to content

feat(codex): pick, clear and auto-assign each LazyCodex role's reasoning effort - #6960

Merged
lidge-jun merged 22 commits into
devfrom
codex/lazycodex-role-effort-carry
Oct 12, 2026
Merged

lidge-jun merged 22 commits into
devfrom
codex/lazycodex-role-effort-carry

Conversation

@lidge-jun

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

Copy link
Copy Markdown
Owner

Summary

Carries LilMGenius's LazyCodex role reasoning-effort series (#6909, #6908, #6907) onto current dev as one change, with fixes from exact-head review. Supersedes #6907, #6908 and #6909.

Maintainer fixes on top, each reproduced on the contributor head before fixing:

  • Clearing a multiline effort value deleted only its first line and failed with 409 invalid_role_file; clearing a first-line effort dropped the BOM. It now refuses a value that is not a one-line string with 409 unsupported_model_value (same as the setter) and keeps the BOM.
  • After a save whose omo.jsonc mirror failed, changing the model dropped the pending effort retry, leaving TOML high and omo.jsonc low. The retry's effort now rides along with the next save.
  • An auto-assign Apply with no effort proposal sent a model-only PUT and dropped that pending retry; the retry's effort is now resolved inside the save itself, for every save path.
  • Clearing an unterminated last effort line removed the previous line's newline (a bare CR in a CRLF file, so 409). The line is now emptied in place.
  • After a save with a failed mirror and a failed reload, the row showed a stale unpinned effort. A successful save is now published into the role store, so Current and the picker show the confirmed pin even when the reload fails, including across Apply all.
  • The public guide still said auto-assign writes effort only "when the file already has one"; docs and structure/subagents.md now match the behavior.

Co-authored-by: LilMGenius smsmeee@naver.com

Verification

  • bun run typecheck: exit 0.
  • Focused backend: role models, auto-assign, omo mirror, role routes, auto-assign routes, injection suggest, CLI headless parity, test layout, file-size ratchet, skill-ocx, structure-ssot — 277 pass, 0 fail. New TOML-removal and route regressions failed before the fix (31 pass / 7 fail).
  • GUI: role-models, auto-assign and integrations-surfaces — 89 pass, 0 fail; new regressions failed before the fix (16 pass / 11 fail). bun run lint, bun run lint:i18n, bun run build: exit 0.
  • bun run structure:check, bun run skill:surface:check, bun run privacy:scan, git diff --check: exit 0.
  • cd gui && bun test tests: 3264 pass, 0 fail (338 files). Full bun run test: running; result will be added here.
  • The two final-review fixes each failed on the previous head and pass now (unterminated last effort line, resends an effort whose omo.jsonc mirror is still pending).
  • Sandbox render (OPENCODEX_HOME/CODEX_HOME/HOME in a temp dir, LazyCodex detected, three roles, explorer pinned to high):

Pinned row with the effort picker open, showing Inherit effort
Inherit effort picked on the pinned row, Save enabled
Dark theme, effort picker open
Role table at 390px, controls wrapped

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.

Summary by CodeRabbit

  • New Features
    • Configure reasoning effort alongside the model for each LazyCodex role, or choose to inherit the default.
    • Clear a role’s effort override. Unsupported values are rejected without changing the role settings.
    • Automatic role suggestions now include an effort when the selected model supports effort levels.
  • Bug Fixes
    • Saving model or effort changes preserves unrelated settings and keeps confirmed updates visible when reloading fails.
    • Failed configuration mirrors can be retried without losing the selected effort.

LilMGenius and others added 20 commits October 12, 2026 05:07
- PUT /api/codex-agent-roles/{role} treated null like an omitted effort and kept the pin; null now removes model_reasoning_effort and the omo.jsonc reasoning
- Codex resolves a role without its own effort from the spawn value, the [agents] default or the parent, so the docs, structure contract and test name no longer promise the model default
- structure/clients/integrations.md listed the reasoning cases without the null that removes it along with the role file's override
…nc settings

- The route and helper fixtures held only model and reasoning, so rebuilding the role as { model } on null would have passed
A role whose file sets no model_reasoning_effort got a model and no effort, so applying the proposal
left the effort to Codex's default even though the sizing had chosen one. Roles now always get the
sized effort on the picked model's ladder, as the delegation suggestion already did, and the
alwaysProposeEffort switch that told the two apart is gone.
…el has a ladder

- structure/subagents.md still limited role effort proposals to files that already set model_reasoning_effort
The role table showed and saved the model only, so the effort in the role file could be changed only
by hand or through auto-assign. Each row now has an effort picker beside the model, offering the same
levels as the Subagents page's delegation model, and the current pin reads "model · effort".
With the effort picker in its own column the table outgrew a 390px screen and Save scrolled out of
view. Model, effort and Save now share one cell that wraps, as the model picker and Save did before.
…t field

- The seeded role list lacked efforts, so the effort picker spread undefined and the placement test crashed
- The hint still said Save rewrites only the model line, which the effort picker made false; every locale follows
- Picking just a reasoning effort enables Save, sends the effort with the unchanged model, and shows both in Current
- A failed /api/injection-model read rejected the whole load; the table now falls back to each row's pinned effort
- A mirror retry rebuilt its body from the row, which still held the old effort until the reload landed or after it failed, so Retry could undo the saved effort; the drafts and the retry now keep the saved model and effort until a mirror succeeds
- A model-only save resent the pinned effort, so a pin the server does not declare made the model change fail with invalid_effort; the PUT now carries effort only when it changed, the row still shows the pin, and a mirror retry resends exactly the submitted body
- The integrations guide named only the model mirror; a GUI save also writes reasoning when the effort changed and LazyCodex supports it
…g BOM

Clearing a role effort with a null PUT deleted only the opening line of a multiline value, so the edit failed the post-write parse with 409 invalid_role_file, and clearing a first-line effort dropped the BOM. Refuse a value without a one-line span with unsupported_model_value, as the setter does, and keep the BOM.

Co-authored-by: LilMGenius <smsmeee@naver.com>
…d saves

Every row offers Inherit effort, which sends effort: null. An unchanged effort is omitted, a null auto-assign proposal stays omitted, a pending omo.jsonc mirror retry survives a model change, and a successful save is published into the role store so a failed reload cannot show a stale pin.

Co-authored-by: LilMGenius <smsmeee@naver.com>
Align the integrations guide and subagent contract with the carried behavior.

Co-authored-by: LilMGenius <smsmeee@naver.com>
@coderabbitai

coderabbitai Bot commented Oct 11, 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: 1e137c2f-1d12-4ed0-84e6-e40d1a5e9fc2

📥 Commits

Reviewing files that changed from the base of the PR and between 7af092c and 55bde3d.


📒 Files selected for processing (32)
  • docs-site/src/content/docs/guides/integrations.md
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/fr.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/pt.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/tr.ts
  • gui/src/i18n/vi.ts
  • gui/src/i18n/zh-TW.ts
  • gui/src/i18n/zh.ts
  • gui/src/pages/integrations/LazyCodexRoleAutoAssign.tsx
  • gui/src/pages/integrations/LazyCodexRoleModels.tsx
  • gui/src/styles/lazycodex-role-models.css
  • gui/tests/integrations-surfaces.test.tsx
  • gui/tests/lazycodex-role-auto-assign.test.tsx
  • gui/tests/lazycodex-role-models.test.tsx
  • skills/ocx/references/01_surface_agents-routing.md
  • src/cli/capabilities-base.ts
  • src/codex/agent-role-models.ts
  • src/codex/role-auto-assign.ts
  • src/server/management/codex-agent-role-routes.ts
  • src/server/management/codex-role-auto-assign.ts
  • structure/clients/integrations.md
  • structure/subagents.md
  • tests/clients/omo-role-models.test.ts
  • tests/codex-integration/injection-model-suggest-routes.test.ts
  • tests/routing/codex-agent-role-models.test.ts
  • tests/routing/codex-role-auto-assign.test.ts
  • tests/server/codex-agent-role-routes.test.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; 7 remain after this review.



📝 Walkthrough

Walkthrough

The change adds reasoning-effort selection and inheritance for Codex roles. Role APIs and files now support clearing eligible effort pins, and auto-assignment proposes effort based on the selected model’s ladder. The dashboard, tests, and documentation cover these behaviors.

Changes

Codex role reasoning effort

Layer / File(s) Summary
Role effort persistence and clearing
src/codex/agent-role-models.ts, src/server/management/codex-agent-role-routes.ts, tests/routing/codex-agent-role-models.test.ts, tests/server/codex-agent-role-routes.test.ts, tests/clients/omo-role-models.test.ts, docs-site/src/content/docs/guides/integrations.md, structure/subagents.md
The role writer accepts null to remove an eligible root effort assignment. The route passes explicit null to the mirror and includes it in the response. Clearing multiline or non-string values returns 409 unsupported_model_value without changing either file.
Effort proposals for auto-assignment
src/codex/role-auto-assign.ts, src/server/management/codex-role-auto-assign.ts, tests/codex-integration/injection-model-suggest-routes.test.ts, tests/routing/codex-role-auto-assign.test.ts, tests/server/codex-role-auto-assign-routes.test.ts, src/cli/capabilities-base.ts, skills/ocx/references/01_surface_agents-routing.md, docs-site/src/content/docs/guides/integrations.md, structure/subagents.md
Auto-assignment now proposes effort for sized roles when the selected model has an effort ladder. Models without a ladder produce no proposal; applying that proposal preserves an existing pin. CLI and guide text describe the updated behavior.
Dashboard effort controls and save state
gui/src/pages/integrations/LazyCodexRoleModels.tsx, gui/src/pages/integrations/LazyCodexRoleAutoAssign.tsx, gui/src/styles/lazycodex-role-models.css, gui/src/i18n/*.ts, gui/tests/integrations-surfaces.test.tsx, gui/tests/lazycodex-role-models.test.tsx, gui/tests/lazycodex-role-auto-assign.test.tsx
The role table loads effort choices, displays an effort selector, and supports selecting or inheriting effort. Saves update cached role data and retain retry payloads when mirror writes fail. The dashboard tests cover effort saves, retries, and reload failures.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant RoleSettingsUI
  participant CodexAgentRoleRoute
  participant RoleFileWriter
  participant OmoMirror
  RoleSettingsUI->>CodexAgentRoleRoute: PUT model and effort
  CodexAgentRoleRoute->>RoleFileWriter: Write, preserve, or clear role effort
  CodexAgentRoleRoute->>OmoMirror: Update or clear reasoning
  CodexAgentRoleRoute-->>RoleSettingsUI: Return role result, including null effort
Loading

Merge Risk: ⚪ Minimal · up to 55bde

The reviewed changes are mergeable after normal checks; applying a proposal without an effort choice preserves the role’s existing setting.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 5.26% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 27 files. (5 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely summarizes the main changes: selecting, clearing, and auto-assigning reasoning effort for each LazyCodex role.
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.

Full details: Docstring Coverage

Explanation

Docstring coverage is 5.26% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 27 files. (5 skipped: 5 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · 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

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Oct 11, 2026
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed.

Hygiene

✅ Deterministic PR hygiene checks passed.

lidge-jun added a commit that referenced this pull request Oct 11, 2026
lidge-jun and others added 2 commits October 12, 2026 05:24
… effort line

Clearing an unterminated last model_reasoning_effort line spliced it out with its preceding newline, leaving a bare CR in a CRLF file (409 invalid_role_file) and dropping the final newline in an LF file. Empty the line instead.

Co-authored-by: LilMGenius <smsmeee@naver.com>
Resolve a pending omo.jsonc retry's effort inside save, so an auto-assign Apply with no effort proposal carries it too instead of clearing the retry with a model-only PUT.

Co-authored-by: LilMGenius <smsmeee@naver.com>
@lidge-jun
lidge-jun marked this pull request as ready for review October 11, 2026 20:28
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 11, 2026 20:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 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-10-11T20:31:21.924473Z 55bde3d 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.

@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: 55bde3dc6d

ℹ️ 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".

const changed = draft !== "" && draft !== row.model;
const retryMirror = !changed && draft !== "" && mirrorRetries[row.role] === draft;
const effortDraft = effortDrafts[row.role] ?? row.effort ?? "";
const changed = draft !== "" && (draft !== row.model || effortDraft !== (row.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 Allow effort-only saves for roles without model pins

When a role inherits its model (row.model === null) but has a pinned model_reasoning_effort, draft is empty, so this condition remains false even after the user selects Inherit effort or another effort; Save stays disabled unless the user also chooses and pins a model. Such roles are valid and already represented by the response shape, so clearing or changing their effort should not require replacing model inheritance with a model pin; support an effort-only update through the UI/API instead.

AGENTS.md reference: gui/AGENTS.md:L10-L10

Useful? React with 👍 / 👎.

@lidge-jun
lidge-jun merged commit 7258420 into dev Oct 12, 2026
44 checks passed
@lidge-jun
lidge-jun deleted the codex/lazycodex-role-effort-carry branch October 12, 2026 06:41
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration into dev (MAINTAINERS.md dev-only path; actor @lidge-jun, admin), merged as 7258420 with the Co-authored-by trailer for @LilMGenius kept in the squash message. #6907, #6908 and #6909 were closed as superseded after this landed.

  • Reviewed and merged head: 55bde3dc6d, bound with --match-head-commit.
  • Exact-head Cross-platform CI passed. Local union on dev 7af092ca4f: typecheck 0, structure:check 0, ratchet 0, lint:gui 0, lint:i18n 0, GUI build 0, Lab boundary 25/0, bun run test:changed 9,015 pass / 32 skip / 0 fail.

Correction: the open Codex finding at LazyCodexRoleModels.tsx:179 (a role that inherits its model cannot change or clear a pinned effort without also pinning a model) was not resolved before this merge. That was a miss on the integration side. The finding is valid; a follow-up PR will add effort-only saves for model-inheriting roles in the UI and API. Separately, the fr/ja/ko/ru/tr/zh-cn/zh-tw integrations guide sections from #6907 were not carried here and will follow in a docs PR.

lidge-jun added a commit that referenced this pull request Oct 12, 2026
Restores the fr, ja, ko, ru, tr, zh-cn and zh-tw LazyCodex role reasoning-effort sections from #6907 that #6960 did not carry, corrected to the behavior on dev: the per-locale "Inherit effort" label, the null clear and its 409 unsupported_model_value refusal, auto-assign proposing an effort for every sized role, an empty ladder never clearing a pin, and the Retry omo.jsonc button including a carried null. The English guide gains the matching Retry omo.jsonc paragraph.

Co-authored-by: LilMGenius <smsmeee@naver.com>
lidge-jun added a commit that referenced this pull request Oct 12, 2026
…inning a model (#6975)

A LazyCodex role that inherits its model but pins model_reasoning_effort could not change or clear that effort: Save required a non-empty model draft and PUT /api/codex-agent-roles/{role} required a model. Such a row can now save an effort on its own and keeps inheriting its model.

model is optional on the PUT route: omitting it leaves the role file's model pin and the omo.jsonc model untouched, omitting effort keeps the effort, and null effort clears it. A request with neither is refused with 400 empty_update before either file is read, and model: null with 400 invalid_model, because a save never removes a model pin. The omo.jsonc mirror only changes reasoning on an effort-only save. Model-only saves, auto-assign Apply, the mirror retry and ocx agent roles set behave as before. The omoComments string in all 11 GUI locales no longer names .model.

Resolves the open review finding on #6960 (discussion_r4243110906).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants