-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: Make detached longwork final delivery ownership explicit #80450
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.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.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.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.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Summary
Detached or migrated long-running work needs an explicit final-delivery owner when origin, work, and update threads are not the same surface.
Today it is possible for a child/subagent completion to be surfaced through more than one legitimate path, for example:
That cross-thread visibility is useful when it is intentional, but duplicate full final summaries are confusing when there is no explicit dual-delivery contract.
Why this is separate from related duplicate-delivery work
This is not the same class as same-response duplicate delivery where a single assistant response both calls
message.sendand emits matching normal assistant text. That path is being addressed separately in #80445.This issue is about multi-surface longwork orchestration: source/origin thread, work thread, update thread, and child completion delivery may all be valid concepts, but there is no first-class owner for the final user-visible summary.
It is also adjacent to #75973, which exposes final metadata for hooks without raw text or routing behavior. This request is about the delivery/ownership policy that can use such metadata safely.
Expected behavior
For detached/migrated work, OpenClaw should have one explicit final-summary owner. Example modes:
work-thread-final: the complete final summary is delivered only to the work thread; the origin thread may receive at most a short pointer/status note.origin-bridge-final: the complete final summary is delivered only to the origin/update thread through a validated bridge-back path; the work thread may receive at most a short pointer/status note.The runtime or helper contract should make it difficult to accidentally publish the same full final summary to both threads.
Actual behavior / risk
A longwork migration can produce two full final summaries across different Discord threads when both of these happen:
A second related risk is that requester-scoped child discovery can make a newer work thread appear to have no relevant worker, even though an older/source thread already has a matching child still running or about to complete. That can lead to duplicate worker launches unless the migration packet carries the exact child session identity or the operator checks visible session lineage.
Proposed shape
Add a first-class contract field or API concept for final ownership, for example:
{ "originThread": "<origin/update surface>", "workThread": "<work surface>", "updateThread": "<single explicit update target>", "deliveryMode": "same-thread | bridge-back", "completionOwner": "work-thread-final | origin-bridge-final", "childSessionKey": "<exact child session identity>" }The important invariant is:
Possible implementation directions:
Evidence level
This was observed in a real Discord longwork migration, then locally mitigated by adding an explicit
completionOwnerfield to a deployment-side detach/admission contract and regression tests for the contract helper.I do not have a minimal upstream runtime test case yet. The current request is to decide the intended first-class ownership model before turning it into a runtime-level PR.
Acceptance criteria