Repository navigation
fix(acp): deliver bound follow-up turns to external harnesses - #110261
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 9:04 PM ET / August 10, 2026, 01:04 UTC. ClawSweeper reviewWhat this changesThe 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 provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep 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 Priority: P2 Review scores
Verification
How this fits togetherA 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]
Decision needed
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
Agent review detailsSecurityNone. PR surfaceSource +37, Tests +50. Total +87 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest 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 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
c39c0d5 to
26b4db3
Compare
|
Status: land-ready, blocked only by an unrelated main-side shard failure.
Rerun CI once the shard heals and this should go green as-is. |
a95d039 to
5d60477
Compare
a5c678f to
96fe2ea
Compare
96fe2ea to
ead5c51
Compare
|
Merged via squash.
|
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.waitpayload 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
prepared reply dispatch runtime owner was not published for claudeafter authentication and bind succeeded.unexpected prepared reply dispatch owner opencodeatsrc/auto-reply/reply/dispatch-from-config.gather.ts:330; the same focused command passes on this head: 1 passed, 339 skipped.node scripts/run-vitest.mjs run --config test/vitest/vitest.live.config.ts src/gateway/gateway-acp-bind.live.test.ts: 7 passed, 1 skipped without live credentials.tbx_01kzmgbsab360q3ye7xcd92r33:node scripts/check-changed.mjscompleted withexitCode: 0after typecheck, lint, import-cycle, boundary, formatting, package, and guard checks.ClawSweeper rank-up moves
Direct Codex contract inspection
Inspected sibling
openai/codexcommit57f42a81131ccf5933e7ec5dc659c381eeb5d72bdirectly:codex-rs/app-server-protocol/src/protocol/v2/thread.rs:311-325defines resuming a persistent thread bythread_id.codex-rs/app-server-protocol/src/protocol/v2/turn.rs:71-75bindsturn/startto that thread id.codex-rs/app-server/src/request_processors/turn_processor.rs:474-576loads the thread and submits the new user input.codex-rs/app-server/src/thread_state.rs:158-177retains the non-empty final agent message.codex-rs/app-server/src/bespoke_event_handling.rs:1020-1034,1268-1302publishes item and terminal turn completion.The OpenClaw failure occurred before any of those harness-specific contracts were invoked.