Skip to content

docs: clarify mechanistic difference between Codex Code Mode and Openclaw Code Mode #83390

Closed as not planned

Description

@Kaspre

Scope: Docs gap directly in the Openclaw Code Mode addition introduced by #80600 — the addition created the naming overlap with the pre-existing Codex Code Mode and the current docs don't disambiguate strongly enough. Surfaced while testing #80600 on 2026.5.16-beta.4.

Problem

Two distinct features both called "code mode" exist in Openclaw, with fundamentally different mechanisms. The current docs distinguish them only briefly, and operators (and bug reporters) routinely conflate the two.

Aspect Codex Code Mode Openclaw Code Mode
Default state On in @openclaw/codex 2026.5.16+ for every codex-routed agent (unconditional features.code_mode: true + code_mode_only: true in buildCodexRuntimeThreadConfig) Off (opt-in via tools.codeMode.enabled: true)
Origin Codex coding harness (separate runtime) PR #80600 — Openclaw-owned, generic
Model writes Shell scripts JavaScript / TypeScript
exec input field command code
Sandbox Codex's own (process-level + filesystem rules) QuickJS-WASI in-process VM
Integration with Openclaw hooks Through codex internal channels Routes through Openclaw's before_tool_call per design

Change and value

Strengthen docs/reference/code-mode.md so the mechanistic difference between the two features is unambiguous:

  1. Replace the short distinguishing paragraph (lines 16–22) with a comparison table like the one above.
  2. Cross-link from any codex-side docs noting these are two differently-implemented features that happen to share a name.

Who's affected

  • Bug reporters and maintainers — "code mode is broken" is currently ambiguous about which mechanism is involved
  • Anyone planning an evaluation: the two features have different sandboxes, hooks integration, and failure modes

Evidence

Codex Code Mode dispatch sample (codex harness on openai/gpt-5.5, 2026-05-17):

{ "command": "wc -c .../MEMORY.md" }
{ "command": "tail -50 ../inbox.jsonl 2>/dev/null | grep -c '\"status\": \"pending\"'" }

Openclaw Code Mode dispatch sample (Pi runtime on ollama-cloud/glm-5.1, 2026-05-17):

{ "code": "const important = 1; return important;", "language": "javascript" }
{ "code": "await tools.call('session_status', {})", "language": "javascript" }

Same tool name (exec), entirely different input shape and execution path.

Related

  • [codex] Add generic OpenClaw code mode #80600 (the PR introducing Openclaw Code Mode)
  • See companion issue on ctx.agentId propagation for Openclaw Code Mode exec dispatch — the naming overlap makes that bug harder to discover.

Activity

  1. Kaspre commented on May 18, 2026

    @Kaspre
    ContributorAuthor

    Companion bug filing: #83387 — ctx.agentId undefined in before_tool_call for outer OC code-mode exec dispatch. The naming overlap is part of why that bug is subtle.

  2. clawsweeper commented on May 18, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 29, 2026, 9:33 PM ET / 01:33 UTC.

    Summary
    Keep open. Current main and the latest release still lack the requested side-by-side comparison and stronger Codex-side anchor, while the open linked PR is the active closing path.

    Reproducibility: not applicable. as a runtime reproduction; this is a documentation clarity request. Source inspection confirms current main and v2026.6.10 still lack the requested comparison table and Codex-side comparison anchor.

    Root-cause cluster
    Relationship: canonical
    Canonical: #83390
    Summary: This issue is the canonical docs request; the open linked PR is the active candidate fix, and the older overlapping PR is closed unmerged.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    Next step
    No new repair lane should be queued because the open linked PR already owns the docs-only fix.

    Review details

    Best possible solution:

    Review and land #90151, then let this issue close through the linked PR merge.

    Do we have a high-confidence way to reproduce the issue?

    Not applicable as a runtime reproduction; this is a documentation clarity request. Source inspection confirms current main and v2026.6.10 still lack the requested comparison table and Codex-side comparison anchor.

    Is this the best way to solve the issue?

    Yes. A focused docs PR is the right layer, and the open linked PR already owns the requested table, cross-link, and source-accurate Codex wording.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Current public docs remain ambiguous for readers until the linked docs PR lands.

    Codex review notes: model internal, reasoning high; reviewed against 54b09580f61b.

    Label changes

    Label justifications:

    • P3: This is a low-risk documentation clarification with no requested runtime behavior change.
    Evidence reviewed

    What I checked:

    • Repository policy applied: Root AGENTS.md, docs/AGENTS.md, src/agents/AGENTS.md, and the documentation review overlay were read; the Codex-source inspection gate and docs link/source-accuracy rules applied to this review. (AGENTS.md:1, 54b09580f61b)
    • Current main still has the docs gap: Current main distinguishes the two code-mode surfaces only in prose and still says Codex Code Mode and Codex-native dynamic tool search are stable Codex harness surfaces; it has no side-by-side comparison table. Public docs: docs/reference/code-mode.md. (docs/reference/code-mode.md:17, 54b09580f61b)
    • Current Codex harness docs lack the requested comparison anchor: The current Codex harness page links to OpenClaw code mode generally, but not to a side-by-side comparison section because that section is absent on main. Public docs: docs/plugins/codex-harness.md. (docs/plugins/codex-harness.md:32, 54b09580f61b)
    • Latest release still has the same gap: Release v2026.6.10 contains the same short prose distinction and stable-surface wording, so the requested clarification has not shipped. Public docs: docs/reference/code-mode.md. (docs/reference/code-mode.md:17, aa69b12d0086)
    • Open linked PR owns the requested fix: Live GitHub data shows docs: clarify OpenClaw vs Codex code mode #90151 is open, mergeable, labeled docs/proof supplied, and linked as closing this issue; its diff adds the comparison anchor/table and Codex harness reverse link. (5685d141cc65)
    • OpenClaw code-mode source contract checked: Current source resolves OpenClaw code mode as disabled by default, QuickJS-WASI-backed, and JavaScript/TypeScript-capable through code-mode config. (src/agents/code-mode.ts:201, 54b09580f61b)

    Likely related people:

    • steipete: Authored and merged the PR that introduced generic OpenClaw code mode, its runtime, tests, config surface, and initial documentation now being clarified. (role: feature introducer; confidence: high; commits: b0c9278ffd2e, f5f83dc2cf8f, 0db097936568; files: docs/reference/code-mode.md, src/agents/code-mode.ts, src/agents/code-mode.worker.ts)
    • Pick-cat: Authored the open linked PR that adds the requested comparison table, Codex harness reverse link, and Codex feature-stage corrections. (role: active candidate fix owner; confidence: high; commits: 5685d141cc65; files: docs/reference/code-mode.md, docs/plugins/codex-harness.md, docs/tools/tool-search.md)
    • HemantSudarshan: Authored the earlier closed unmerged PR that targeted the same docs clarification, useful context if maintainers compare prior approaches. (role: previous overlapping docs contributor; confidence: medium; commits: 5daaa4227f74; files: docs/reference/code-mode.md, docs/plugins/codex-harness.md)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  3. added
    P3
    clawsweeper:queueable-fix
    clawsweeper:fix-shape-clear
    on May 18, 2026
  4. changed the title [-]docs: clarify mechanistic difference between Codex Code Mode and OC generic code mode[/-] [+]docs: clarify mechanistic difference between Codex Code Mode and Openclaw Code Mode[/+] on May 18, 2026
  5. added
    issue-rating: 🌊 off-meta tidepool
    on May 18, 2026
  6. added
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    and removed
    clawsweeper:fix-shape-clear
    clawsweeper:queueable-fix
    on Jun 15, 2026
  7. openclaw-barnacle commented on Jul 14, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  8. added
    stale
    on Jul 14, 2026
  9. openclaw-barnacle commented on Jul 21, 2026

    @openclaw-barnacle

    Closing due to inactivity.
    If this is still an issue, please retry on the latest OpenClaw release and share updated details.
    If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.

  10. locked as resolved and limited conversation to collaborators on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3clawsweeper:linked-pr-openclawsweeper:no-new-fix-prissue-rating: 🌊 off-meta tidepoolstale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions