Skip to content

Preserve customized Codex agent reasoning effort across LazyCodex reinstall #18

@tully-8888

Description

@tully-8888

Summary

LazyCodex/OmO bundled Codex agent role customizations are not durable in the latest npm release. If a user changes installed ULW agent TOML defaults, for example changing codex-ultrawork-reviewer, momus, and plan from model_reasoning_effort = "xhigh" to "high", running the LazyCodex installer again silently restores the bundled xhigh defaults.

This makes the Codex subagent side-chat UI correctly show Extra High again after reinstall/sync, even though the user previously changed the role defaults to high.

Environment

  • LazyCodex version: lazycodex-ai@4.7.5
  • OmO plugin version: omo@0.1.0
  • Codex version: codex-cli 0.136.0
  • OS: Ubuntu 24.04 on Linux ARM64
  • Node/npm: Node v22.22.2, npm/npx 10.9.7
  • Install method: npx lazycodex-ai@latest install --no-tui --codex-autonomous
  • Relevant config: OmO installs bundled Codex agent roles into CODEX_HOME/agents/ as symlinks on Linux.

Reproduction

  1. Install latest LazyCodex into an isolated Codex home:
    TMP_HOME=/tmp/lcx-codex-home-repro
    rm -rf "$TMP_HOME"
    mkdir -p "$TMP_HOME"
    CODEX_HOME="$TMP_HOME" npx lazycodex-ai@latest install --no-tui --codex-autonomous
  2. Observe the bundled default efforts:
    rg -L -n '^model_reasoning_effort = ' "$TMP_HOME/agents" | sort
    Relevant output:
    /tmp/lcx-codex-home-repro/agents/codex-ultrawork-reviewer.toml:5:model_reasoning_effort = "xhigh"
    /tmp/lcx-codex-home-repro/agents/momus.toml:5:model_reasoning_effort = "xhigh"
    /tmp/lcx-codex-home-repro/agents/plan.toml:5:model_reasoning_effort = "xhigh"
    
  3. Change the installed agent defaults to high:
    perl -0pi -e 's/model_reasoning_effort = "xhigh"/model_reasoning_effort = "high"/g' \
      "$TMP_HOME/agents/plan.toml" \
      "$TMP_HOME/agents/momus.toml" \
      "$TMP_HOME/agents/codex-ultrawork-reviewer.toml"
  4. Confirm the active installed agent paths now show high:
    rg -L -n '^model_reasoning_effort = ' "$TMP_HOME/agents" | sort
  5. Re-run the installer:
    CODEX_HOME="$TMP_HOME" npx lazycodex-ai@latest install --no-tui --codex-autonomous
  6. Re-check the active installed agent paths:
    rg -L -n '^model_reasoning_effort = ' "$TMP_HOME/agents" | sort

Expected Behavior

LazyCodex should provide a durable way to keep user-selected agent defaults across reinstall/sync/update.

Acceptable behavior would be one of:

  • preserve local edits in CODEX_HOME/agents/*.toml;
  • store user overrides separately and reapply them after relinking bundled roles;
  • document and expose an official override path for role default model and reasoning effort;
  • warn before overwriting local role customizations.

Actual Behavior

Re-running the latest installer restores bundled xhigh values.

Observed with lazycodex-ai@4.7.5:

tmp_home=/tmp/lcx-codex-home-latest-20260603-091341

after local customization:
/tmp/lcx-codex-home-latest-20260603-091341/agents/codex-ultrawork-reviewer.toml:5:model_reasoning_effort = "high"
/tmp/lcx-codex-home-latest-20260603-091341/agents/momus.toml:5:model_reasoning_effort = "high"
/tmp/lcx-codex-home-latest-20260603-091341/agents/plan.toml:5:model_reasoning_effort = "high"

after reinstall:
/tmp/lcx-codex-home-latest-20260603-091341/agents/codex-ultrawork-reviewer.toml:5:model_reasoning_effort = "xhigh"
/tmp/lcx-codex-home-latest-20260603-091341/agents/momus.toml:5:model_reasoning_effort = "xhigh"
/tmp/lcx-codex-home-latest-20260603-091341/agents/plan.toml:5:model_reasoning_effort = "xhigh"

The installer reports that it relinked the role files during both installs:

Linked agent codex-ultrawork-reviewer.toml -> /tmp/lcx-codex-home-latest-20260603-091341/.tmp/marketplaces/sisyphuslabs/plugins/omo/components/ultrawork/agents/codex-ultrawork-reviewer.toml
Linked agent momus.toml -> /tmp/lcx-codex-home-latest-20260603-091341/.tmp/marketplaces/sisyphuslabs/plugins/omo/components/ultrawork/agents/momus.toml
Linked agent plan.toml -> /tmp/lcx-codex-home-latest-20260603-091341/.tmp/marketplaces/sisyphuslabs/plugins/omo/components/ultrawork/agents/plan.toml

Evidence

On Linux, the installed role files are symlinks:

codex-ultrawork-reviewer.toml -> /tmp/lcx-codex-home-latest-20260603-091341/.tmp/marketplaces/sisyphuslabs/plugins/omo/components/ultrawork/agents/codex-ultrawork-reviewer.toml
momus.toml -> /tmp/lcx-codex-home-latest-20260603-091341/.tmp/marketplaces/sisyphuslabs/plugins/omo/components/ultrawork/agents/momus.toml
plan.toml -> /tmp/lcx-codex-home-latest-20260603-091341/.tmp/marketplaces/sisyphuslabs/plugins/omo/components/ultrawork/agents/plan.toml

The bundled plugin docs describe this as install-time behavior:

Bundled agent role TOMLs in `agents/` ship to `CODEX_HOME/agents/` at install time, not via a runtime hook. The installer creates a symlink on Linux / macOS and a file copy on Windows...
Both code paths overwrite stale files and write a `.installed-agents.json` manifest...

The bundled defaults currently include:

components/ultrawork/agents/codex-ultrawork-reviewer.toml:5:model_reasoning_effort = "xhigh"
components/ultrawork/agents/momus.toml:5:model_reasoning_effort = "xhigh"
components/ultrawork/agents/plan.toml:5:model_reasoning_effort = "xhigh"

Root Cause

The installer treats bundled agent TOMLs as managed artifacts and relinks/restores them from the installed marketplace snapshot on every install. Because Linux installs use symlinks into the marketplace snapshot, editing CODEX_HOME/agents/*.toml edits the linked target, but the next install refreshes that target from the package defaults.

There does not appear to be a durable user override layer for role default model / model_reasoning_effort, so local customizations are lost.

Proposed Fix

Add a persistent override mechanism for bundled Codex agent role defaults, or make install-time linking preserve local customizations.

Likely implementation paths:

  • In the installer path that links/copies cached plugin agents, detect an existing user-customized CODEX_HOME/agents/<name>.toml and preserve/reapply selected fields such as model and model_reasoning_effort.
  • Add a dedicated override file, for example under CODEX_HOME/agent-overrides/*.toml or a config section in CODEX_HOME/config.toml, and merge those fields after installing bundled defaults.
  • If preserving edits is intentionally unsupported, print a warning during install and document the official way to override default role effort.

Likely component based on bundled docs:

  • src/cli/install-codex/link-cached-plugin-agents.ts
  • OmO ultrawork agent source files under components/ultrawork/agents/*.toml
  • OmO model catalog defaults under model-catalog.json for verifier routing

Verification Plan

  • Reproduce current behavior with isolated CODEX_HOME and confirm reinstall resets high back to xhigh.
  • Apply the fix and repeat the same isolated repro; after reinstall, codex-ultrawork-reviewer, momus, and plan should remain at the user-selected high value or the installer should clearly warn that bundled role files are managed.
  • Regression check: a clean install with no overrides should still install the bundled default agent roles and should still register OmO in CODEX_HOME/config.toml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions