Repository navigation
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Description
When calling sessions_spawn(runtime="acp", agentId="claude") to invoke Claude Code ACP, a TypeError occurs and the ACP session fails to execute properly.
Error
TypeError: Cannot use "in" operator to search for "method" in 1
Root Cause
- acpx runtime successfully created and registered
- TypeError occurs when processing ACP adapter messages
- Code expects
{ method: "...", params: {...} }format object - Actually receives number
1(likely ACK response or other non-object type) - acpx does not properly handle this non-object type message
Environment
- OpenClaw: 2026.6.1
- Platform: macOS 14.1.2 (Darwin 23.1.0)
- Node: v24.15.0
- claude-agent-acp: 0.39.0
- Claude CLI: 2.1.162
- Gateway: local mode, WebSocket on 127.0.0.1:18789
- Gateway service: LaunchAgent installed, loaded, running
- Agents: 4 (main, xiaohong, hermes, claude)
- Sessions: 90 active
- Memory: enabled (plugin memory-core)
Steps to Reproduce
- Configure ACP agent (claude or hermes)
- Call
sessions_spawn(runtime="acp", agentId="claude", task="...") - Observe that the returned session has empty messages
- Check stability log and find TypeError
Stability Log Evidence
Unhandled rejection at runtime:
- acpx-runtime phases completed successfully
- TypeError: Cannot use "in" operator to search for "method" in 1
- Timestamp aligns with sessions_spawn calls
Suggested Fix
acpx should:
- Check if message is object type before using
inoperator - Handle non-object type responses properly (e.g., ACK numbers)
- Add type guard before checking
methodfield
Workaround
Use subagent mode instead of ACP mode: sessions_spawn(runtime="subagent", agentId="xiaohong", task="...")
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon Jun 4, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 21, 2026, 7:37 AM ET / 11:37 UTC.
Summary
Keep open: current main and the latest release still expose the ACPX primitive-frame failure path, and #95130 is the active open candidate fix that uses closing syntax for this issue.
Reproducibility: yes. Source inspection shows current main still lets primitive JSON stdout frames reach acpx, acpx enqueues them, and the pinned ACP SDK applies
"method" in messagebefore object narrowing; I did not run a live credentialed Claude ACP session.Root-cause cluster
Relationship:
canonicalCanonical: #90404
Summary: This issue is the canonical report for the ACPX primitive-frame TypeError; the active open PR is the current candidate fix and the older closed PR attempted the same root-cause area.
Members:
fixed_by_candidate: fix: prevent Claude ACP sessions from failing on primitive adapter frames #95130 - The open PR uses closing syntax for this issue and changes generated ACPX wrapper behavior to filter primitive/null/array stdout frames before acpx reads them.same_root_cause: fix(acpx): add type guard for non-object ACP messages (#90404) #94014 - The closed unmerged PR attempted a dependency-patch guard for the same primitive-message failure but is no longer a viable canonical landing path.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
An open linked PR already uses closing syntax and owns the candidate fix, so a new repair lane should not start.
Review details
Best possible solution:
Review and land or revise #95130; if that PR is rejected, fix the object-shape validation at the acpx/ACP SDK boundary with regression coverage for primitive, null, string, array, request, response, and notification frames.
Do we have a high-confidence way to reproduce the issue?
Yes. Source inspection shows current main still lets primitive JSON stdout frames reach acpx, acpx enqueues them, and the pinned ACP SDK applies
"method" in messagebefore object narrowing; I did not run a live credentialed Claude ACP session.Is this the best way to solve the issue?
Yes on direction, not yet on completion. The narrow maintainable end state is object-shape validation before ACP dispatch; the active question is whether maintainers accept the OpenClaw wrapper mitigation in #95130 or require the guard in acpx/ACP SDK.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against d1cbe29f3d52.
Label changes
Label changes:
clawsweeper:needs-maintainer-review: Current issue advisory state no longer selects this label.Label justifications:
P1: A released ACP sessions_spawn workflow can fail before delivering Claude ACP output for affected users.impact:message-loss: The reported TypeError leaves the spawned ACP session with empty messages instead of returning runtime output.Evidence reviewed
What I checked:
extensions/acpx/AGENTS.md:7, d1cbe29f3d52)extensions/acpx/src/codex-auth-bridge.ts:434, d1cbe29f3d52)extensions/acpx/src/codex-auth-bridge.ts:728, d1cbe29f3d52)src/agents/acp-spawn.ts:1089, d1cbe29f3d52)extensions/acpx/src/service.ts:357, d1cbe29f3d52)extensions/acpx/package.json:11, d1cbe29f3d52)Likely related people:
extensions/acpx/src/codex-auth-bridge.ts,extensions/acpx/src/service.ts,extensions/acpx/src/runtime.ts)extensions/acpx/src/codex-auth-bridge.ts,extensions/acpx/src/service.ts,extensions/acpx/src/runtime.ts)extensions/acpx/src/runtime.ts,extensions/acpx/package.json,extensions/acpx/AGENTS.md)extensions/acpx/src/codex-auth-bridge.ts,extensions/acpx/src/codex-auth-bridge.test.ts)extensions/acpx/src/codex-auth-bridge.ts,extensions/acpx/src/runtime.ts,src/agents/acp-spawn.test.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.YingzuoLiu commentedon Jun 5, 2026
Adding one thought from a runtime/protocol-boundary angle.
I agree with the earlier review that the clean fix may need to happen at the ACP SDK / acpx boundary rather than only catching the exception inside OpenClaw. The part that stands out to me is that this failure is not just a local TypeError: a primitive or malformed inbound message can escape shape validation and bring down the ACP dispatch path, leaving the spawned session with empty messages.
A useful regression test might explicitly cover the dispatcher boundary with several message shapes:
{ method: ... }message{ id: ... }message1null, string, or array valuesThe expected behavior would be that only valid protocol objects reach the method dispatcher. Primitive or malformed payloads should either be ignored if they are valid control/ACK messages for the protocol, or surfaced as structured protocol errors, rather than throwing from
"method" in message.joelnishanth commentedon Jun 16, 2026
Working on a fix for this. Will have a PR up shortly.
— Joel Nishanth · offlyn.AI
fix(acpx): add type guard for non-object ACP messages (openclaw#90404)
vincentkoc commentedon Jun 23, 2026
acpx now has the upstream parser fix in draft openclaw/acpx#403. The NDJSON boundary drops top-level primitives/null/arrays before the ACP SDK dispatcher, with regression coverage. OpenClaw PR #95130 remains useful as a mitigation for bundled older acpx versions, but the shared fix belongs upstream.
vincentkoc commentedon Jun 23, 2026
Update: the shared acpx parser fix is merged in openclaw/acpx#403 (
de042d1, released on acpx main). OpenClaw still needs to bump its bundled acpx dependency; the wrapper mitigation in #95130 can then be reconsidered against the released upstream guard.vincentkoc commentedon Jun 23, 2026
Resolved by the merged ACPX inbound-frame fix in openclaw/acpx#403 and consumed by OpenClaw in #96068. ACPX now ignores non-object frames before protocol inspection, so the
inoperator TypeError path is gone. Closing with the canonical fix.