Repository navigation
fix: session announcements fail after successful replies - #147150
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 3:57 PM ET / 19:57 UTC (Revision 3). ClawSweeper reviewWhat this changesGives delayed session announcements an independent cleanup lifetime and carries the selected agent into text, media, and voice delivery, with regression coverage. Merge readiness✅ Ready for maintainer review The repair remains necessary on current main. No actionable introduced defect was found, and the recorded qualification addresses the previous review’s outstanding request. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s session-send tool starts work in another conversation and can announce its completed reply. Gateway admission tracks that background work, while the delivery layer sends the announcement to the target conversation’s channel. flowchart TD
A[Session send request] --> B[Resolve and authorize target]
B --> C[Target agent reply]
C --> D[Detached announcement work]
D --> E[Resolve target channel]
E --> F[Gateway send with selected agent]
F --> G[Channel delivery and transcript]
D --> H[Release work reservations]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -3, Tests +69. Total +66 across 8 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep announcement work on the shared detached-lifetime owner and preserve explicit target ownership through Gateway delivery. Do we have a high-confidence way to reproduce the issue? Yes: current source retains the inherited resource scope and omits the owner on text sends; the recorded baseline and after-fix Gateway scenarios exercise those failures. This review did not execute them. Is this the best way to solve the issue? Yes: the patch reuses the landed lifetime owner and carries an already-resolved agent instead of adding another helper, routing fallback, or permission model. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 03c70bad04ef. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Integrate the landed detached-continuation owner from #144801. Keep the sessions_send caller repair, post-foreground announcement regression, and nonduplicate admission-fence coverage. Preserve the canonical helper and descendant tests.
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Merged via squash.
|
…7150) * fix(agents): retain sessions send announcement work after foreground completion * fix(agents): preserve announcement target ownership * fix(agents): type alternating session reply owners
Related: #145865
What Problem This Solves
Fixes:
sessions_sendannouncements can fail after a successful peer reply, either because the sending turn has finished or because a text announcement omits its known delivery owner in a multi-agent setup.User Impact
The target conversation receives the delayed announcement and its session finishes healthy. Existing tool restrictions, caller retirement, Gateway affinity, and restart/suspension checks remain enforced.
Why This Change Was Made
Use the detached continuation already landed by @LiuwqGit in #144801, preserving the caller, prepared-generation, and transcript cleanup wrappers. The duplicate helper implementation and descendant test are removed from this PR; distinct admission-fence coverage remains.
Carry the already-resolved target agent into both announcement delivery paths for text, media, and voice. This removes media-only owner rediscovery and leaves Gateway ownership checks and transcript mirroring intact. No config, protocol, or permission model changes.
The automatic-reset caller remains separate in #146350.
Evidence
Final signed candidate:
0a1e6624dcb90a4f0fe64c5f76a226a17b1a956c, composed with landed helper base48ed702f644974d220de27666d3e25be20ec5249.Async work scope is closedafter foreground completion. A later helper-composed real Gateway run reached the announcement turn but failed text delivery because the send request omitted its explicit target owner.bb9d94912cfd05be62eb376647ef704841c80a17: all 502 tests across six owner/sibling files passed; the hot-reload Gateway E2E passed; the private-QA build passed, 52 built modules were verified, and doctor closures were checked. Testbox infrastructure run. These assertions ran in its native remote command, not hosted PR CI.done, without an error, and all root reservations were released. The router's forced MCP call and an excluded peer remained denied; exactly one allowed MCP call executed.string | undefinedannotation on the alternating reply-loop owner. Final-candidate autoreview is scoped-clean with no P0–P2 findings.Behavior verdict on
bb9d94912cfd05be62eb376647ef704841c80a17:{"ok":true,"runtime":"embedded Pi","provider":"scripted OpenAI Responses","channel":"qa-channel","mcpCalls":1,"routerMcpDenied":true,"excludedPeerDenied":true,"callerAuthorityRetirementObserved":true,"targetAnnouncementCount":1,"targetStatus":"done","lastRunError":null,"remainingRoots":0,"flowDiagnostics":[]}Proof limits: this exercises actual Gateway and channel delivery with mock provider/channel endpoints. The fixture used an explicit two-agent A2A allow set with sandboxing off; sandboxed routing was not exercised. This is not live QQ, external-provider, Codex-native, or requester-channel announcement proof; announcements follow the selected target session's channel. The related issue remains a separate closeout decision.
Identity, scope, and follow-up
Complete final patch SHA-256:
e6bce7b28346eaedfe61cf6609dc576479ab35ad9459562289d2ba846ab2eb29; treef1903f8ed2ff94e6cd2d74cc4d21d53a037d9a38.Eight files: production +12/-15 (net -3); tests +153/-84. The shared helper is supplied solely by the landed dependency. Admission tests retain the distinct suspension-fence invariant also raised by @sunlit-deng in #144806.
The original combined command passed behavior proof but stopped at a moving-main assertion-baseline comparison. Correct staged qualification then exposed the reply-loop type inference error; the final annotation fixes that compile-time mismatch without changing execution.
Named follow-up outside this repair:
sessions-send-tool.tsperforms an eager requester route lookup withpeer.kind: "direct"before its later direct-message guard. In an otherwise valid peer-only channel binding configuration this can demand an account-wide owner. The QA setup declares an explicit research account owner while retaining both stronger peer bindings; no Gateway ownership fallback or permission widening was added.