fix(agents): carry provenance through active subagent wakes#92251
fix(agents): carry provenance through active subagent wakes#92251ooiuuii wants to merge 2 commits into
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
|
@clawsweeper re-review Updated the |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Retrying after the previous targeted re-review fired while the PR still had queued/cancelled checks. Current |
|
@clawsweeper re-review Retrying now that the ClawSweeper execution queue has drained. Current PR checks for head |
|
@clawsweeper re-review Current head |
c0d4598 to
869b782
Compare
|
@clawsweeper re-review Rebased onto current |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
869b782 to
e59ba5b
Compare
e59ba5b to
e68b577
Compare
|
Thanks @ooiuuii for narrowing this after the earlier delivery-receipt discussion and for proving the active-wake path without claiming more than the trace showed. The linked incident set is now closed: #91356 was closed not reproducible after a live current-main Telegram/Crabbox pass, and #91330 / #91333 were closed without adopting terminal-source-reply inference. This branch has also drifted past a safe refresh point: its merge base is Current main carries explicit inter-session provenance at the direct-agent handoff and durable generated-media queue boundaries (direct handoff, durable queue). Active steering now also has newer transcript-recorder, stale-run, injectable-backend, and queue-compatibility contracts (active steer, reply-run admission). Replaying the old Closing as stale, with thanks. If an agents/delivery owner wants active-wake provenance hardened on current main, please re-file or reopen with that owner request; the focused active-wake, retry, media, and reply-run fixtures here remain useful re-port material for a new bounded patch. |
Summary
Refs #91356, #91330, #91333.
Carry typed
inputProvenancethrough active subagent wake steering so resumed requester turns keep an explicit inter-session provenance signal instead of arriving as untyped queued messages.This is intentionally narrower than the closed #91333 approach. It does not suppress automatic-mode finals based on ordinary
message(action="send")receipts, and it does not infer terminal source-reply ownership frommessageId, target matching, or prose.Why
The maintainer feedback on #91330/#91333 clarified the unsafe boundary: a successful send proves delivery, but it does not prove that the send was the terminal source reply. That replacement needs an explicit terminal-source-reply contract and thread identity; this PR does not attempt that.
This patch only handles the active wake side: when a subagent completion wakes an active requester session, the runtime already knows this is an inter-session wake. The queued steering message should carry that typed provenance through the active run / reply-run bridge so downstream routing and final-selection logic can reason from explicit metadata instead of an untyped internal wake.
Changes
inputProvenance.AgentSession.steer(text, images)call shape while allowingsteer(text, { images, inputProvenance }).applyInputProvenanceToUserMessage.subagent_announce/ completion provenance through active requester wake queue options.Real behavior proof
Behavior or issue addressed: active subagent completion wakes could cross the requester-session boundary as untyped steering messages, even though the runtime already knows the wake is an inter-session
subagent_announce/completion handoff.Real environment tested: local OpenClaw source checkout at PR head
c0d4598971eb73a7d6b0787fa3b0cb09b21bb592on branchagent/xiaozhua/active-wake-provenance-clean. The after-fix runtime proof used a temporary OpenClaw test state/config on macOS with channels/cron/browser/canvas disabled and exercised the realdeliverSubagentAnnouncementactive-wake dispatch path. The final queue sink was instrumented only to capture the active embedded-run queue options, so no private channel, model, or credential was required.Exact steps or command run after this patch:
Evidence after fix:
Additional local gate evidence from the same PR head:
Observed result after fix: the active requester wake stayed on the
steeredpath and queued exactly one active embedded-run message. The captured queue options include explicitinputProvenancewithkind: "inter_session",sourceSessionKey: "agent:subagent:redacted-child",sourceChannel: "webchat", andsourceTool: "subagent_announce", plussteeringMode: "all"andwaitForTranscriptCommit: true. This shows the runtime handoff now carries provenance through the active wake boundary instead of sending an untyped steering message.What was not tested: no live Telegram/Slack/bncr end-to-end run was performed on this machine because Docker is not installed here and no provider API env vars are present in the shell (
OPENAI_API_KEY,GEMINI_API_KEY,GOOGLE_API_KEYabsent). #91356 was closed as not reproducible in current core, so this PR remains framed as route/provenance boundary hardening rather than a claimed live-channel product fix.