Skip to content

fix(acp): deliver bound follow-up turns to external harnesses - #110261

Merged
steipete merged 1 commit into
mainfrom
claude/acp-bind-strict-claude
Aug 10, 2026
Merged

steipete merged 1 commit into
mainfrom
claude/acp-bind-strict-claude

Conversation

@steipete

@steipete steipete commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Refs #109684.

What Problem This Solves

Bound ACP follow-up turns could fail before reaching Claude, Codex, or Gemini because the Gateway treated the external ACP harness id in the bound target session key as a configured OpenClaw model-runtime owner. The terminal reason was also hidden by a live-test helper that reported only status=error.

Why This Change Was Made

The Gateway now keeps two identities distinct during a bound ACP reroute: the configured source agent owns the prepared reply-dispatch runtime, while the bound ACP session still owns ACP policy, state, transcript, and execution. This preserves the prepared publication invariant without adding a fallback or publishing synthetic owners for external harness ids.

The live test now includes the full bounded agent.wait payload in failures, correlates the first textual reply after the uniquely tokened user turn, and removes every Claude-only assertion, retry, fallback, and timeout exemption.

User Impact

Messages sent to a conversation bound to an ACP session can reach the bound harness again even when its harness id is not an entry in agents.list. Claude is held to the same live bind contract as Codex and Gemini, and future terminal failures retain their actionable reason.

Evidence

ClawSweeper rank-up moves

  • Applied: repaired the rerouted-turn runtime failure without restoring connector-specific exemptions.
  • Applied with scoped evidence: the exact-head live behavior passed, while the post-test process-group leak is independently proven in both the pre-fix and repaired runs.

Direct Codex contract inspection

Inspected sibling openai/codex commit 57f42a81131ccf5933e7ec5dc659c381eeb5d72b directly:

  • codex-rs/app-server-protocol/src/protocol/v2/thread.rs:311-325 defines resuming a persistent thread by thread_id.
  • codex-rs/app-server-protocol/src/protocol/v2/turn.rs:71-75 binds turn/start to that thread id.
  • codex-rs/app-server/src/request_processors/turn_processor.rs:474-576 loads the thread and submits the new user input.
  • codex-rs/app-server/src/thread_state.rs:158-177 retains the non-empty final agent message.
  • codex-rs/app-server/src/bespoke_event_handling.rs:1020-1034,1268-1302 publishes item and terminal turn completion.

The OpenClaw failure occurred before any of those harness-specific contracts were invoked.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Jul 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 9:04 PM ET / August 10, 2026, 01:04 UTC.

ClawSweeper review

What this changes

The PR makes bound ACP follow-up turns load the prepared reply runtime for the configured source agent rather than the external ACP harness identifier, and strengthens live ACP test diagnostics and correlation.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer review. Current main still loads the prepared Gateway runtime using the bound ACP harness identity, while this PR preserves the source agent as that runtime owner and continues routing ACP execution to the bound session. The patch has no discrete correctness finding, but the repository-required direct Codex source inspection cannot be completed in this sandbox and the PR carries the protected maintainer label.

Priority: P2
Reviewed head: ead5c5183cc6be757e6cfd520651d00d1330c1cb
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused, source-backed owner-boundary repair with substantive regression coverage; remaining review is the repository-required Codex contract gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This is maintainer-authored work; the PR body nevertheless supplies an exact-head credentialed ACP run and focused regression evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-authored work; the PR body nevertheless supplies an exact-head credentialed ACP run and focused regression evidence.
Evidence reviewed 7 items Current-main failure boundary: Current main derives sessionAgentId from the bound ACP key and passes it to the published Gateway runtime loader; an external harness id is not necessarily a configured runtime owner.
PR preserves the two owners: The PR loads the prepared runtime from the source session agent only for bound ACP dispatch, while retaining the bound session key for downstream ACP routing.
ACP execution remains target-owned: The route creates its reply-dispatch event with acpDispatchSessionKey, and the ACP plugin resolves that event session through its ACP session manager before running the external turn.
Findings None None.
Security None None.

How this fits together

A Gateway follow-up message can be bound to an external ACP session. Gateway must use a configured OpenClaw agent for its prepared dispatch facts, then pass the bound ACP session key to the ACP plugin so the external harness owns execution and transcript state.

flowchart LR
  A[Follow-up message] --> B[Gateway dispatch]
  B --> C[Resolve bound ACP session]
  C --> D[Load source agent runtime]
  D --> E[ACP reply-dispatch hook]
  E --> F[External harness turn]
  F --> G[Bound transcript and channel reply]
Loading

Decision needed

Question Recommendation
Can the maintainer confirm the direct Codex App Server contract and accept the PR's supplied exact-head ACP live proof before merge? Verify the Codex contract, then approve: Inspect the local sibling Codex thread and turn-resume path, then approve if it confirms that the failure is wholly before harness invocation.

Why: Repository policy requires the acting reviewer to inspect sibling Codex source before a Codex-related merge or proof-sufficiency verdict; that source is unavailable in this read-only sandbox.

Before merge

  • Resolve merge risk (P1) - Direct inspection of the required sibling Codex source is unavailable here, so this review cannot complete the repository's dependency-contract gate for Codex-related behavior.
  • Complete next step (P2) - A protected maintainer PR needs a maintainer to complete the repository-required direct Codex contract inspection; there is no mechanical repair finding to dispatch.
Agent review details

Security

None.

PR surface

Source +37, Tests +50. Total +87 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 39 2 +37
Tests 1 102 52 +50
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 141 54 +87

Review metrics

Metric Value Why it matters
Production versus test LOC production +8/-1; tests +133/-53 The small production increase is justified by the explicit source-runtime ownership boundary, with most change devoted to regression and live-proof coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #109684
Summary: This PR is a candidate fix for the closed report's bound ACP follow-up failure; it targets the shared Gateway runtime-owner boundary rather than an individual harness.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Have a maintainer perform the required direct Codex App Server contract inspection, then land this owner-boundary repair after the exact-head checks finish green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Have a maintainer perform the required direct Codex App Server contract inspection, then land this owner-boundary repair after the exact-head checks finish green.

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

Yes, source-reproducible: current main asks the published runtime registry for the bound ACP harness-derived id at src/auto-reply/reply/dispatch-from-config.gather.ts:330, while the PR regression test demonstrates that a bound target must still execute through ACP after the source runtime is selected.

Is this the best way to solve the issue?

Unclear: the source-owner/runtime and target-owner/ACP split is the narrowest maintainable repair, but repository policy requires direct Codex source inspection before calling the Codex-related proof sufficient.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: Bound ACP follow-up delivery is a real but limited workflow failure, with a focused repair and no demonstrated broad runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is maintainer-authored work; the PR body nevertheless supplies an exact-head credentialed ACP run and focused regression evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the prepared-runtime lookup to this contributor, who also authored the focused owner-boundary repair. (role: recent runtime-boundary contributor; confidence: high; commits: 2904bbfc475c, ead5c5183cc6; files: src/auto-reply/reply/dispatch-from-config.gather.ts, src/auto-reply/reply/dispatch-from-config.abort-and-dedupe.test-utils.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Perform the direct sibling Codex source inspection required by repository policy before approving the exact-head live proof.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • 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.

History

Review history (8 earlier review cycles)
  • reviewed 2026-07-18T00:26:51.130Z sha c39c0d54bf7b97c4c16f30c8fbcc55d578d32058 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-18T01:01:02.312Z sha 26b4db3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-29T22:09:16.547Z sha 26b4db3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T08:21:11.306Z sha 26b4db3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T06:37:17.011Z sha 26b4db3 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T07:40:01.704Z sha 26b4db3 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-09T19:54:54.643Z sha 5d60477 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-09T23:49:34.637Z sha 5d60477 :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

Status: land-ready, blocked only by an unrelated main-side shard failure.

  • This PR changes exactly one file, src/gateway/gateway-acp-bind.live.test.ts — a .live.test.ts that hosted CI does not execute.
  • The failing job (checks-node-compact-large-2, shard agentic-agents-support) fails on src/agents/cli-runner/model-call-diagnostics.test.ts — "does not create diagnostics without an active event listener" — deterministically across attempts 1 and 2. That test passes 10/10 in isolation locally on this head, so another test in the shard is leaking an agent-event listener; the breakage is on current main and will hit any PR.
  • Live proof for this change: codex bind lane 5/5 on this head; claude bind lane 5/5 on the near-identical earlier strict revision (real Max OAuth token, every probe attempt 1). Autoreview clean after three hardening rounds.

Rerun CI once the shard heals and this should go green as-is.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 29, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 8, 2026
@steipete steipete self-assigned this Aug 9, 2026
@steipete
steipete force-pushed the claude/acp-bind-strict-claude branch 2 times, most recently from a95d039 to 5d60477 Compare August 9, 2026 18:26
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. P2 Normal backlog priority with limited blast radius. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 9, 2026
@steipete
steipete force-pushed the claude/acp-bind-strict-claude branch 2 times, most recently from a5c678f to 96fe2ea Compare August 10, 2026 00:32
@steipete steipete changed the title test(acp): hold claude to the same live bind bar as codex and gemini fix(acp): deliver bound follow-up turns to external harnesses Aug 10, 2026
@steipete
steipete force-pushed the claude/acp-bind-strict-claude branch from 96fe2ea to ead5c51 Compare August 10, 2026 00:54
@clawsweeper clawsweeper Bot added the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label Aug 10, 2026
@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 10, 2026
@steipete
steipete merged commit a3b4c0a into main Aug 10, 2026
131 checks passed
@steipete
steipete deleted the claude/acp-bind-strict-claude branch August 10, 2026 01:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant