Skip to content

Repository files navigation

Reasoning & Exploration Fixes

A Codex++ tweak that patches Codex Desktop's renderer JavaScript bundles at load time to keep reasoning, exploration items, file edits, and tool outputs visible — with no app bundle modifications.

New to the tweak? See the interactive explainer (v1.3) → for the v1.2 explainer → for the original debugging timeline and v1.1 → v1.2 migration story. a visual walkthrough: what it does, how source patching works, patch cards, and a v1.1 → v1.3 comparison with the full debugging timeline.


Installation

git clone https://github.com/shivam2014/codex-plusplus-reasoning-fixes.git \
  ~/Library/Application\ Support/codex-plusplus/tweaks/co.shivam94.reasoning-fixes

For local development:

codexplusplus dev . --no-watch --replace

Settings

All settings persist across restarts. Source-backed toggles take effect on the next conversation reload. The UI shows a warning next to any toggle whose source rule no longer matches the current Codex version.

Section Option Default Mechanism
Exploration Keep accordion open ON React fiber hook (no reload)
Reasoning Show reasoning ON Source patch (split-items)
Reasoning Reasoning display Expanded CSS injection (no reload)
Reasoning Disable thinking shimmer ON Source patch (shimmer)
File Edits Show file edits in chat ON Source patch (split-items)
Exploration Items Show exploration items ON Source patch (split-items)
Collapse Show collapse/expand button ON DOM / CSS toggle (no reload)

Files

co.shivam94.reasoning-fixes/
├── manifest.json          # Tweak manifest (v1.3.0)
├── index.js               # Renderer settings UI, fiber hook, collapse-all button
├── source-patcher.js      # Main-process protocol-wrapper and source transformer
├── scripts/
│   └── verify-patches.js  # Offline patch verification against extracted ASAR
├── docs/
│   ├── index.html         # Interactive visual explainer
│   └── validate-html.mjs  # HTML validation script
├── SITREP.md              # Architecture notes, patch inventory, compatibility
└── screenshots/           # Settings page and reasoning view screenshots

Patch reference

Source patches (regex-based, applied at window reload)

Patch Bundle What it does
show-reasoning split-items Reasoning items as standalone render items
render-standalone-reasoning thread Bypasses null-renderer branch for reasoning
reasoning-start-expanded thread useState(o)useState(true)
reasoning-no-autocollapse thread Removes setExpanded(false) on finish
reasoning-no-blink thread Disables streaming blink on reasoning label
reasoning-no-animate-height thread Zero-duration height transition
no-layout-position thread Disables Framer Motion layout:"position"
disable-shimmer shimmer Stops the pulsing text animation
show-exploration-items split-items Standalone exploration entries
fix-assistant-order split-items Corrects agent-item message ordering
file-edits-no-tool-group split-items Keeps patches out of tool-activity grouping
auto-expand-exec thread defaultExpandExecShell: true
expand-tool-activity thread defaultExpanded: true on tool sections
thought-fade-disable markdown Disables Wn fadeIn spans during streaming
thought-fade-disable-un markdown Disables Un fadeIn wrapper during streaming

Runtime features (no reload needed)

Feature How it works
Exploration keep-open Wraps React fiber useState setter for accordion
Reasoning display style Injected <style> overriding scrollbox height
Collapse-all button CSS class toggle on <body> via floating DOM button

Auto-healing

v1.3.0 introduces skeleton-based auto-healing. Each patch has a loose match regex with capture groups for JavaScript identifiers. When the exact regex fails after a Codex update, the auto-heal engine:

  1. Runs the skeleton match against the bundle → captures variable names
  2. Regenerates the replacement using captured names
  3. Verifies the output matches the verify pattern

Persistence: healed patterns are cached to api.storage per Codex version so they survive restarts without re-healing.

Current status against Codex v26.519.41501: 15/15 patches working (11 exact match + 4 auto-healed).


Compatibility

inspectRule() tests each patch rule against the served source:

Status Meaning
active Patch matched exactly and was applied
healed_auto Exact match failed, skeleton auto-healed it
not_applied Unpatched pattern found, waiting to apply
already Patched pattern present — skip (idempotent)
unsupported Neither pattern matches → warning in UI
structural_rewrite Code moved to a different bundle or removed
mixed Ambiguous — treated as unsupported

Protocol interception

v1.3.0 uses a dual approach to intercept app:// bundle requests:

  • Approach A: Patch protocol.handle to wrap future handler registrations
  • Approach B: Register protocol.interceptBufferProtocol as a file-serving handler that reads directly from the ASAR, applies Statsig gate patches (compatible with co.bennett.computer-use), and applies reasoning-fixes source patches

Approach B ensures the tweak works even when the Computer Use tweak's interceptBufferProtocol would otherwise replace the app:// handler.


Acknowledgments

  • Alex Naidis (TheCrazyLex) — in-memory protocol-level source patching architecture; file-edits, shimmer, and keep-agent-expanded patches (PR #2).
  • Codex++ (b-nnett/codex-plusplus) — tweak runtime, settings injection, IPC, and React fiber API.
  • Original patch (andrew-kramer-inno's gist) — inspiration for the source transformations.

About

Codex++ tweak: Keep exploration panels open and show reasoning items in the message log

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages