Skip to content

[Bug]: Codex app-server deferred OpenClaw tools are advertised but tool_search resolves app connectors #99464

Description

@100yenadmin

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Codex app-server workers can be told that deferred OpenClaw dynamic tools are available through tool_search, but tool_search may resolve a different connector universe instead of OpenClaw tools.

Steps to reproduce

  1. Run an OpenClaw Codex app-server worker with searchable/deferred OpenClaw dynamic tools.
  2. Confirm the worker developer instructions include the deferred-tool guidance from extensions/codex/src/app-server/thread-lifecycle.ts, including Deferred searchable OpenClaw dynamic tools available: ... Use tool_search to load exact callable specs before use.
  3. In the worker, ask for an OpenClaw session/subagent tool such as sessions_spawn.
  4. Observe the tool_search result set.

Observed incident evidence from worker 019f18dc-0080-7201-a969-4efa8dd87949, parent 019f18d0-e106-7e02-a41e-3ff009b592bd, on PR openclaw/openclaw#98186:

  • tool_search("sessions_spawn") returned no tools.
  • tool_search("sessions status send spawn OpenClaw session subagent") returned connector namespaces such as Calendly, Linear, and GitHub, not OpenClaw session tools.
  • tool_search("lcm_grep recall conversation") returned GitHub and Google Drive connector namespaces, not LCM/OpenClaw tools.
  • The worker made 225 shell exec_command calls and no GitNexus/OpenClaw code-intelligence calls.

Expected behavior

If OpenClaw advertises deferred OpenClaw dynamic tools to a Codex app-server worker, tool_search should resolve those exact OpenClaw tools, or the runtime should fail loudly and switch to a safe/direct tool-loading path.

Actual behavior

The worker was instructed to use tool_search for OpenClaw tools, but tool_search resolved the wrong universe. The worker then fell back to raw shell and GitHub CLI inspection.

OpenClaw version

OpenClaw 2026.7.1-beta.1 (2b4f94f).

Operating system

macOS 26.4 build 25E246.

Install method

Local OpenClaw install with Codex app-server plugin.

Model

Codex app-server worker using gpt-5.5 with xhigh reasoning.

Provider / routing chain

OpenClaw sessions_spawn worker -> Codex app-server -> OpenAI/Codex model route.

Additional provider/model setup details

The local Codex plugin reported version 2026.6.11. The incident worker was a spawned Codex worker, not a direct user turn.

Logs

Redacted/summarized incident telemetry:

worker_thread_id=019f18dc-0080-7201-a969-4efa8dd87949
parent_thread_id=019f18d0-e106-7e02-a41e-3ff009b592bd
pr=openclaw/openclaw#98186
task_shape=small agent-via-gateway timeout-default fix
total_worker_tokens=23,868,003
input_tokens=23,816,033
output_tokens=51,970
reasoning_output_tokens=19,640
exec_command_calls=225
tool_search_calls=3
gitnexus_or_openclaw_code_intelligence_calls=0

Screenshots, recordings, and evidence

Relevant source shape:

  • extensions/codex/src/app-server/thread-lifecycle.ts:1705 says OpenClaw has dynamic tools for messaging, cron, sessions, media, gateway, and nodes.
  • extensions/codex/src/app-server/thread-lifecycle.ts:1730 advertises deferred searchable OpenClaw dynamic tools through tool_search.
  • extensions/codex/src/app-server/dynamic-tools.ts:356 intentionally keeps OpenClaw session spawning searchable so native Codex spawn_agent remains primary for Codex subagents.
  • src/agents/embedded-agent-runner/run/attempt.tool-search-run-plan.ts:93 builds live allowed tool names from catalog tools when deferred tools are callable.
sequenceDiagram
    participant OC as OpenClaw Codex app-server
    participant W as Codex worker
    participant TS as tool_search
    participant Shell as Raw shell fallback

    OC->>W: Developer instructions advertise deferred OpenClaw tools
    W->>TS: search "sessions_spawn"
    TS-->>W: no OpenClaw session tool
    W->>TS: search "sessions status send spawn OpenClaw session subagent"
    TS-->>W: Calendly/Linear/GitHub connector namespaces
    W->>Shell: falls back to rg/sed/gh polling
    Shell-->>W: large repeated outputs enter worker context
Loading

Impact and severity

Affected: Codex app-server workers spawned by OpenClaw when deferred OpenClaw tools are expected.

Severity: High. A small PR worker burned 23,868,003 tokens in about 47 minutes after failing to discover the intended OpenClaw tools.

Frequency: Observed in one fully captured incident; exact general frequency is not yet known.

Consequence: workers can miss native OpenClaw orchestration/code-intelligence surfaces and fall back to expensive raw shell/GitHub reads.

Additional information

Related issues that may share tool-surface ownership:

  • #85030 MCP tools not injected into sessions_spawn sessions.
  • #97911 tools.deny does not hide skill_workshop from Codex deferred tools.
  • #98300 deferred/tiered registration for model-facing tools.

Suggested fix shape:

  • Add a Codex app-server tool-surface preflight for every turn that advertises deferred OpenClaw dynamic tools.
  • If tool_search cannot resolve advertised OpenClaw tools, either switch those tools to direct loading for the turn or fail loudly with a diagnostic.
  • Add a regression test where sessions_spawn is advertised but tool_search("sessions_spawn") does not resolve it.

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify 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.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions