Skip to content

tools.exec.pathPrepend is not applied to Codex app-server native exec PATH after config change #89837

Description

@dertbv

Summary

tools.exec.pathPrepend is documented/schema-described as directories to prepend to PATH for exec runs, but on OpenClaw 2026.5.28 it does not reach Codex app-server native shell execution. A config edit is detected, but fresh agent turns still run native bash/exec_command with the old PATH.

Observed

Config:

{
  "tools": {
    "exec": {
      "host": "gateway",
      "pathPrepend": ["~/bin"]
    }
  }
}

Gateway log after edit:

[reload] config change detected; evaluating reload (tools.exec.pathPrepend)

No follow-up config hot reload applied or config change applied (dynamic reads: ...) line appears.

A fresh openclaw agent probe using the Codex app-server native shell still shows PATH without the prepended directory, so bare script names in that directory fail to resolve.

What I found

Two things look relevant in the built 2026.5.28 artifacts:

  1. dist/config-reload-plan-*.js classifies the broad tools prefix as kind: "none". For a tools.exec.pathPrepend-only change, buildGatewayReloadPlan() returns a no-op plan, and server-reload-handlers-* returns early before calling the hot-reload state setter. That explains the missing applied/dynamic-read log and stale in-memory config.

  2. The Codex app-server bridge only maps OpenClaw exec policy fields (mode/security/ask) into Codex runtime options. I did not find tools.exec.pathPrepend being merged into appServer.start.env.PATH or otherwise projected to the Codex app-server process/thread. The normal OpenClaw exec tool code does apply pathPrepend, but Codex app-server native shell execution inherits the app-server process PATH instead.

Expected

For Codex app-server native exec runs, OpenClaw should either:

  • honor tools.exec.pathPrepend by prepending those directories to the Codex app-server process/thread execution PATH, and restart/recreate the shared app-server client when the effective prepend changes; or
  • document that tools.exec.pathPrepend does not apply to Codex app-server native execution and provide the supported config surface for that PATH.

Also, if tools.exec.pathPrepend is intended as dynamically read config, the reload path should still update active gateway state and log config change applied (dynamic reads: tools.exec.pathPrepend) rather than returning silently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions