Repository navigation
fix: targetless replies retain conversation correlation - #125283
Conversation
Carry prepared reply policy into embedded and CLI message tools so targetless direct replies retain transport correlation and Reef thread identity.\n\nCloses #125279
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 9:21 AM ET / 13:21 UTC. ClawSweeper reviewWhat this changesThe PR preserves reply-mode context through embedded and CLI-backed message tools and makes Reef targetless direct replies reuse the inbound message thread. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main drops the prepared reply policy before generic message tools, and this branch carries it through the embedded and CLI paths. No concrete patch defect was found, but merge readiness requires after-fix boundary proof and direct Codex-contract inspection for the PR’s Codex MCP claim. Priority: P1 Review scores
Verification
How this fits togetherInbound channel turns prepare a reply policy and message identity for agent tools. Message sending then uses that context to attach a transport reply identifier, which lets a waiting conversation turn recognize the response. flowchart LR
A[Inbound Reef message] --> B[Prepared reply context]
B --> C[Embedded or CLI agent]
C --> D[Targetless message tool]
D --> E[Reef outbound reply]
E --> F[Conversation correlation]
Decision needed
Why: The repository requires boundary or live proof for delivery/session behavior, and the available evidence only demonstrates the pre-fix failure plus unit-level propagation. Before merge
Agent review detailsSecurityNone. PR surfaceSource +46, Tests +98. Total +144 across 16 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep reply policy explicit across the existing embedded, CLI, and loopback boundaries, then prove the exact PR head with two authorized Reef agents or the approved mock-gateway harness before merging. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main omits replyToMode from tool context while the message-action boundary treats a missing mode as off. The supplied live pre-fix report is consistent with that path, but this review did not execute authorized Reef agents. Is this the best way to solve the issue? Yes, provisionally: carrying the admission-time policy through the existing context boundaries is more maintainable than inferring correlation downstream. Its real delivery and correlation effect still needs boundary proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7068006c78a1. 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
|
Keep reply-only inbound messages unthreaded unless the transport supplies a thread, while still anchoring new exchanges to their initiating envelope.\n\nRefs #125279
|
Land-ready proof for
ClawSweeper rank-up move / skip: I am not deploying this unmerged PR head to the two production-like agents. The operator explicitly chose the consistency contract “merge the PR, update all installs to the latest main, then test; worst case, use a follow-up PR.” The pre-fix live run already proved the transport failure boundary. Immediately after merge, both installations will be pinned to one immutable merged The reported “persistent cache schema” is not a stored-data change: |
|
Merged via squash.
|
|
Post-merge live proof completed on exact main SHA Both authorized installations were pinned to that SHA before messaging. Clawstudio → Roboclaw and Roboclaw → Clawstudio each completed inline with a persisted conversation-delivery status of The original failing path was exercised directly: Roboclaw answered the inbound Reef turn through a targetless All four outbound Reef messages have one |
) * fix(agents): preserve contextual reply correlation Carry prepared reply policy into embedded and CLI message tools so targetless direct replies retain transport correlation and Reef thread identity.\n\nCloses openclaw#125279 * fix(reef): preserve unthreaded reply correlation Keep reply-only inbound messages unthreaded unless the transport supplies a thread, while still anchoring new exchanges to their initiating envelope.\n\nRefs openclaw#125279
Closes #125279
AI-assisted.
What Problem This Solves
Fixes an issue where an agent answering an inbound direct message with a targetless
message.sendcould deliver the reply successfully whileconversations_turntimed out. This was reproduced live between two authorized Reef agents: the remote answer and signed delivery receipts arrived, but the reply had no transportreplyToId.Why This Change Was Made
The reply runner now carries its admission-time reply policy into both embedded and CLI-backed message tools instead of dropping or re-deriving it. Reef owns its transport-specific behavior by promoting an unthreaded exchange to the initiating envelope ID and reusing that thread for contextual tool replies, matching its existing automatic reply pipeline.
Correlation remains strict: core still requires an exact transport
replyToIdand never guesses from a shared session or a lone pending turn.User Impact
Synchronous Reef agent-to-agent turns can now recognize targetless message-tool answers as replies instead of reporting a timeout after successful delivery. Other direct-message plugins without custom threading adapters also retain the prepared reply policy, and CLI-backed agents receive the same context as embedded agents.
Evidence
src/auto-reply/reply/agent-runner-utils.test.tsfailed because the preparedoriginatingReplyToMode: "all"disappeared before message-tool construction.node scripts/check-changed.mjs -- <16 changed files>passed all required core, core-test, plugin, and plugin-test lanes after one import-path correction.tbx_01m07y72pvjhqrz8magx1t2026: final-headpnpm buildpassed, exit 0. Run: https://github.com/openclaw/openclaw/actions/runs/32034785334origin/mainrevision8e89e98cf6d4d79f7add5c04ddd4bbd76b1594a1:codex-rs/codex-mcp/src/connection_manager.rsandcodex-rs/rmcp-client/src/rmcp_client.rspass JSON tool arguments through to the MCP server; the new reply policy remains host-owned grant context and does not change Codex's protocol.replyToIdandthreadId. Final two-way live verification will run after this fix is merged and both installations are pinned to the same mergedmainSHA.