Skip to content

[Bug]: Codex Computer Use get_app_state hangs awaiting tools/call from Discord-routed session #96452

Closed

Description

@PollyBot13

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

On current openclaw/main, a Discord/OpenClaw-routed Codex Computer Use call to computer-use.get_app_state for Chrome reaches the MCP tool invocation but hangs until the 120s tools/call timeout, even from a clean helper-client baseline.

Steps to reproduce

  1. Build current openclaw/main at 7844b0844568f8f71040008ef596bc715064657b (OpenClaw 2026.6.10) on macOS.

  2. Run an isolated canary gateway/profile from that build. In my repro this used loopback port 18799 and an isolated ~/.openclaw-canary profile; the production gateway was not changed.

  3. Use an OpenClaw Discord-routed Codex agent turn with the Computer Use plugin/tooling available.

  4. Ensure the helper process baseline is clean before the second attempt: no stale SkyComputerUseClient mcp helpers, only SkyComputerUseService remains.

  5. Ask the agent to call Computer Use directly for Chrome app state, not a shell/browser/screenshot fallback:

    Use the Computer Use tool to get the app state for Google Chrome
    (app identifier com.google.Chrome if supported). Do not use shell,
    browser automation, or screenshots as a substitute.
    
  6. Observe the computer-use/get_app_state tool call hang until timeout.

Expected behavior

The Computer Use call should either return Chrome app state or return a clear actionable Computer Use error. It should not hang until the Codex/MCP tools/call timeout after the approval bridge has already been exercised.

Actual behavior

The live canary call failed twice with a 120s tools/call timeout.

First canary session:

tool call error: tool call failed for `computer-use/get_app_state`

Caused by:
    timed out awaiting tools/call after 120s

Corresponding assistant result:

CU_CANARY_RESULT status=failure detail=computer-use/get_app_state for com.google.Chrome timed out after 120s awaiting tools/call.

Clean-baseline retry after clearing stale SkyComputerUseClient mcp helpers:

tool call error: tool call failed for `computer-use/get_app_state`

Caused by:
    timed out awaiting tools/call after 120s

Corresponding assistant result:

CU_CANARY_RESULT status=failure detail=Computer Use get_app_state for com.google.Chrome timed out after 120s awaiting tools/call.

OpenClaw version

OpenClaw 2026.6.10, source build from openclaw/main at 7844b0844568f8f71040008ef596bc715064657b.

Operating system

macOS 26.5.1 build 25F80, Apple Silicon (arm64).

Install method

Source checkout / pnpm build in an isolated canary worktree and profile. Node v26.3.1.

Model

openai/gpt-5.5

Provider / routing chain

Discord channel session -> OpenClaw canary gateway -> Codex app-server/runtime -> Computer Use MCP plugin/tool call.

Additional provider/model setup details

The canary used an isolated ~/.openclaw-canary profile and loopback gateway port 18799. Canary auth/profile drift was repaired inside the canary profile so the agent could reach the Codex Computer Use tool. No production gateway/config mutation was used for the canary proof.

Logs, screenshots, and evidence

Build/version proof:

$ git rev-parse HEAD
7844b0844568f8f71040008ef596bc715064657b

$ node -v
v26.3.1

$ sw_vers
ProductName:    macOS
ProductVersion: 26.5.1
BuildVersion:   25F80

$ uname -m
arm64

Current-main build and focused Computer Use bridge tests passed before the live canary repro:

pnpm install --frozen-lockfile
pnpm build
pnpm exec vitest run \
  extensions/codex/src/app-server/elicitation-bridge.test.ts \
  extensions/codex/src/app-server/run-attempt.test.ts \
  -t "Computer Use"

Test Files  2 passed
Tests       9 passed

Live canary session evidence from the OpenClaw mirrored session log:

{
  "role": "toolResult",
  "toolName": "computer-use.get_app_state",
  "isError": true,
  "content": [
    {
      "content": "{\n  \"message\": \"tool call error: tool call failed for `computer-use/get_app_state`\\n\\nCaused by:\\n    timed out awaiting tools/call after 120s\"\n}"
    }
  ]
}

Codex session event evidence for the clean-baseline retry:

{
  "type": "mcp_tool_call_end",
  "invocation": {
    "server": "computer-use",
    "tool": "get_app_state",
    "arguments": {
      "app": "com.google.Chrome"
    }
  },
  "plugin_id": "computer-use@openai-bundled",
  "duration": {
    "secs": 120,
    "nanos": 1085792
  },
  "result": {
    "Err": "tool call error: tool call failed for `computer-use/get_app_state`\n\nCaused by:\n    timed out awaiting tools/call after 120s"
  }
}

Clean helper baseline before the final check showed only the service process afterward:

/Users/pollybot/.codex/computer-use/Codex Computer Use.app/Contents/MacOS/SkyComputerUseService

Focused duplicate search did not find an exact existing open issue/PR for this new signature:

Searched: "timed out awaiting tools/call", "awaiting tools/call",
"get_app_state", "computer-use/get_app_state", "Computer Use" + "tools/call".

Exact matches: none.

Related but not exact:

  • #75696 is the older closed Discord/OpenClaw Computer Use approval-denied issue. This repro gets past that earlier immediate denial shape and fails at the actual MCP tools/call completion path.
  • #78303 and #86079 are approval/elicitation hardening lanes.
  • #93559 and #81418 are stale/orphan process cleanup lanes.
  • #83966 / #91266 are dynamic-tool watchdog or approval-timeout-adjacent, but not Computer Use get_app_state tool-call completion.

Impact and severity

Affected: OpenClaw Discord-routed Codex sessions that need Computer Use to operate local Chrome/macOS UI.

Severity: workflow-blocking for GUI/browser tasks through the official Computer Use MCP path. The practical workaround is to avoid mcp__computer_use in Discord sessions and use lower-level usecomputer screenshot/coordinate loops, Playwright, PinchTab, or manual handoff.

Frequency: 2/2 observed live canary attempts on current main, including one attempt after clearing stale helper clients.

Consequence: agents cannot reliably use the official Computer Use tool from this channel path; the call consumes about 120 seconds and then fails without useful app state.

Additional information

This is intentionally filed separately from the older approval-denied symptom. The observed current-main failure mode is:

approval/bridge path no longer fails immediately -> MCP Computer Use tools/call starts -> get_app_state does not return -> 120s timeout

That makes it likely adjacent to Computer Use MCP tool-call lifecycle/completion rather than only the channel-mediated approval UI.

Activity

  1. PollyBot13 commented on Jun 24, 2026

    @PollyBot13
    ContributorAuthor

    @clawsweeper review

    This issue includes current-main canary proof, exact timeout logs, a clean-helper retry, focused bridge-test evidence, and related-but-not-exact issue/PR boundaries. Please assess whether it is queueable/source-repro quality or what proof is still missing.

  2. clawsweeper commented on Jun 24, 2026

    @clawsweeper
    Contributor

    🦞🧹
    ClawSweeper re-review requested.

    I asked ClawSweeper to review this item again.
    Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
    Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

  3. clawsweeper commented on Jun 24, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 24, 2026, 10:04 AM ET / 14:04 UTC.

    Summary
    Keep open: current main still only prepares Computer Use and bridges approval elicitations, while the reported failure occurs later inside Codex MCP tools/call; no exact duplicate or merged fix owns that completion timeout.

    Reproducibility: yes. from reporter-supplied live canary proof, and source inspection confirms the reported error string belongs to the Codex MCP tools/call path; this review did not run a live macOS Discord reproduction.

    Next step
    Needs maintainer/Codex Computer Use owner investigation because source proves the failure is past OpenClaw's approval bridge and inside the Codex MCP tools/call completion path.

    Review details

    Best possible solution:

    Reproduce with redacted app-server/MCP logs, isolate whether the hang is in OpenClaw turn routing or Codex/Computer Use tools/call completion, then make a narrow owner-boundary fix without broadening approvals.

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

    Yes from reporter-supplied live canary proof, and source inspection confirms the reported error string belongs to the Codex MCP tools/call path; this review did not run a live macOS Discord reproduction.

    Is this the best way to solve the issue?

    Unclear: no proposed fix exists yet, and adjacent approval or consent-envelope work does not address the later tools/call completion timeout shown here.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The root cause is not yet isolated between OpenClaw's routed turn lifecycle, Codex app-server MCP request handling, and the Computer Use helper's response behavior.
    • Any repair that changes Computer Use approval or permission handling touches a sensitive desktop-control boundary and should get focused security review.

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

    Label changes

    Label changes:

    • add P1: The report blocks an official Computer Use path for Discord-routed Codex agents on current main and repeatedly burns a full 120-second tool timeout.
    • add impact:crash-loop: The affected Computer Use tool call hangs until the MCP watchdog timeout instead of returning app state or a clear actionable error.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.
    • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.

    Label justifications:

    • P1: The report blocks an official Computer Use path for Discord-routed Codex agents on current main and repeatedly burns a full 120-second tool timeout.
    • impact:crash-loop: The affected Computer Use tool call hangs until the MCP watchdog timeout instead of returning app state or a clear actionable error.
    Evidence reviewed

    Acceptance criteria:

    • Run a live macOS Discord-routed Codex Computer Use turn that calls computer-use/get_app_state for Chrome and confirm it returns app state or a clear actionable error before timeout.
    • Run focused Codex app-server tests covering Computer Use approval routing, for example node scripts/run-vitest.mjs extensions/codex/src/app-server/elicitation-bridge.test.ts extensions/codex/src/app-server/run-attempt.test.ts -t "Computer Use".
    • If OpenClaw code changes, verify /codex computer-use status still reports setup failures accurately and approval elicitations still fail closed when unhandled.

    What I checked:

    • Live issue proof: this issue reports two current-main macOS canary attempts where computer-use/get_app_state for Chrome reached MCP invocation and timed out after 120 seconds, including a clean-helper retry and Codex mcp_tool_call_end evidence.
    • OpenClaw approval bridge exists: Current main routes Computer Use approval elicitations through the Codex app-server elicitation bridge before returning an accept/decline response, so the older immediate approval-denied failure is not the same central problem. (extensions/codex/src/app-server/elicitation-bridge.ts:125, acc2a0ee7297)
    • Run-attempt request surface: The Codex run-attempt handler handles mcpServer/elicitation/request separately from OpenClaw dynamic item/tool/call, matching the issue's claim that this is a Codex-native MCP path rather than the OpenClaw dynamic-tool watchdog. (extensions/codex/src/app-server/run-attempt.ts:2116, acc2a0ee7297)
    • Computer Use setup boundary: OpenClaw's Computer Use setup checks marketplace/plugin/MCP readiness and tool availability, but it does not execute desktop actions itself. (extensions/codex/src/app-server/computer-use.ts:139, acc2a0ee7297)
    • Public docs boundary: The docs state that OpenClaw prepares Codex app-server and then lets Codex own native MCP tool calls during Codex-mode turns; troubleshooting covers setup and list_apps timeout symptoms but not this exact get_app_state completion timeout. Public docs: docs/plugins/codex-computer-use.md. (docs/plugins/codex-computer-use.md:12, acc2a0ee7297)
    • Codex call path: Sibling Codex source shows MCP tool execution calls sess.call_tool(...) and maps failures to tool call error, matching the issue's top-level error text. (../codex/codex-rs/core/src/mcp_tool_call.rs:557, f959e7fc9832)

    Likely related people:

    • pash-openai: Authored merged PR Add Codex Computer Use setup for Codex mode #71842, which added the Codex Computer Use setup path, status/install commands, docs, and the current boundary where OpenClaw prepares Codex app-server but Codex owns native MCP tool calls. (role: feature owner; confidence: high; commits: 67ffa3df8b07; files: extensions/codex/src/app-server/computer-use.ts, docs/plugins/codex-computer-use.md)
    • kesslerio: Local commit and related PR context tie this author to the targeted Codex MCP approval elicitation bridge adjacent to the reported routed-session Computer Use path. (role: introduced adjacent approval behavior; confidence: medium; commits: 701ecb9e4420; files: extensions/codex/src/app-server/elicitation-bridge.ts, extensions/codex/src/app-server/run-attempt.ts)
    • Lucenx9: Authored PR fix(codex): sanitize elicitation approval text #71343, which hardened display text on the same Codex MCP elicitation approval bridge and is relevant if investigation touches approval prompt handling again. (role: recent adjacent contributor; confidence: low; commits: 0764f86e18b3; files: extensions/codex/src/app-server/elicitation-bridge.ts, extensions/codex/src/app-server/elicitation-bridge.test.ts)
    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.
  4. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:crash-loopCrash, hang, restart loop, or process-level availability failure.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    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.
    on Jun 24, 2026
  5. steipete commented on Jun 26, 2026

    @steipete
    Contributor

    Fixed on main by #96818 in commit 8252fc009f223a7bfb91385e0c4d8e9c2608ab80.

    The Codex run watchdog now waits for paired start/completion lifecycle events for every native execution item, including MCP tool calls, so the turn no longer ends while Computer Use is still running. Verification covered 87 focused lifecycle tests, direct upstream Codex protocol/event-mapping source, a fresh clean autoreview, and the full exact-head hosted CI matrix.

    Thanks for the detailed live reproduction and event evidence.

  6. locked as resolved and limited conversation to collaborators on Jul 16, 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

    P1High-priority user-facing bug, regression, or broken workflow.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: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:crash-loopCrash, hang, restart loop, or process-level availability failure.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