Skip to content

fix(talk): return yielded subagent results to voice - #129535

Merged
vincentkoc merged 5 commits into
mainfrom
fix/talk-subagent-completion-reattach
Sep 9, 2026
Merged

vincentkoc merged 5 commits into
mainfrom
fix/talk-subagent-completion-reattach

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Talk could acknowledge delegated subagent work and remain responsive, but the consolidated result returned only to chat after the requester yielded. Two follow-up defects also allowed transcript-only finals to omit their visible text and retained callbacks to outlive a replaced Talk Gateway owner.

Related: #129186, #129144, #121894, #118499, #118505

Why This Change Was Made

  • Keep durable subagent settlement and the consolidated requester wake as the single source of truth.
  • Register one bounded, process-local presentation attachment for the exact Talk requester turn.
  • Promote it only after durable yielded settlement is frozen.
  • Append the visible consolidated answer once to the currently authorized provider delegation.
  • Derive transcript-only visible final text from the committed delivery outcome.
  • Revalidate the current Gateway owner synchronously before forwarding and revoke retained registration synchronously on replacement.
  • Retain retryable work while revoking presentation authority on cancellation, close, detach, replacement, lifecycle rotation, expiry, stale ownership, steering failure, or terminal delivery failure.
  • Add no public SDK, config, environment, protocol, SQLite, catalog, manifest, package, or tool-policy surface.

User Impact

Talk can delegate work without blocking the live conversation. The consolidated parent answer returns to chat and the active voice delegation exactly once. Retired owners cannot speak a late result.

Exact-Head Evidence

  • Head: fa2bf20e148536c1c33dcf3bf12712206bc4a6b9
  • Pre-fix regressions reproduced: two transcript-only visible-final failures and one immediate replacement-revocation failure.
  • Focused tests: 603/603 passed across settlement, registration, promotion, consumption, duplicate rejection, lifecycle revocation, steering, requester-final attachment, Talk relay, Gateway ownership, and provider controller paths.
  • Focused repair suites: delivery 296/296; Gateway 36/36.
  • Hosted CI exposed a controller max-lines violation and a stale owner request type that omitted requesterFinal. The controller-local types now live in a scoped companion module and the owner runner advertises the real request shape.
  • Exact-head CI-repair validation: both affected lint stripes passed; focused Gateway/requester-final tests passed 38/38.
  • Build passed.
  • Native i18n verification passed with 3,784 entries unchanged.
  • Diff formatting, conflict-marker, privacy, and secret scans passed.
  • Mandatory exact-head autoreview completed with zero P0/P1 findings.
  • check:changed passed the changed-file gates and stopped only at one unrelated repository-wide compatibility record that became due on September 9, 2026.

Real Provider Authority Proof

An isolated exact-source build used the current Platform API-key path and a real provider socket. The public proof contains only sanitized booleans, counters, and monotonic timings.

{
  "providerSocketOpen": true,
  "yieldedAcknowledgementBeforeFinal": true,
  "requesterFinalRegistered": true,
  "requesterFinalPromoted": true,
  "requesterFinalConsumedOnce": true,
  "duplicateConsumptionRejected": true,
  "activeDelayedFinalExactlyOnce": true,
  "staleRevokedBeforeProviderIo": true,
  "replacedRevokedBeforeProviderIo": true,
  "postAcknowledgementReplacementRejectedBeforeProviderIo": true,
  "postAcknowledgementReplacementRevokedSynchronously": true,
  "postAcknowledgementReplacementRunPreserved": true,
  "cancelledRevokedBeforeProviderIo": true,
  "composedClaimRevokedBeforeProviderIo": true,
  "steeringRetainedOriginalBeforeSuccess": true,
  "steeringRetargetedAfterSuccess": true,
  "privacyScanClean": true,
  "activeDelayedFinalOutboundAppends": 1,
  "duplicateOutboundAppends": 0,
  "staleOutboundSends": 0,
  "postAcknowledgementReplacementOutboundSends": 0,
  "cancelledOutboundSends": 0,
  "composedClaimOutboundSends": 0,
  "successfulConsumptions": 1,
  "duplicateRejections": 1,
  "providerConnectedMs": 4330,
  "yieldedAcknowledgedMs": 4358,
  "simulatedChildFinalMs": 4480,
  "elapsedMs": 5134
}

Artifact: pr3-public-proof.json

Visual Proof

An exact-head, cropped, muted mobile Talk sequence shows the conversation listening before delayed completion and still listening after the completion appears exactly once. The artifact metadata and images passed privacy and secret scans.

  • talk-before-delayed-completion.png
  • talk-after-delayed-completion.png
  • pr3-visual-proof.json
  • Visual test: 1/1 passed.

Dependency Contract

Direct Codex source inspection was refreshed at openai/codex@dafb6781ee76b06ed41bdbe004484087925e22a6:

  • codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs:207-269: spawn starts the child and returns without waiting for completion.
  • codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs:40-117: waiting is explicit.
  • codex-rs/core/src/session/turn_input.rs:472-507: successful steering applies only after exact-turn submission succeeds.
  • codex-rs/app-server/src/request_processors/turn_processor.rs:1018-1127: empty, inactive, and mismatched steering requests are rejected.
  • codex-rs/core/tests/suite/subagent_notifications.rs:931-959: the independent child notification path remains covered.

Review Metrics

  • Final repair commit production delta: +35/-20 (net +15), concentrated in the explicit Gateway owner fence and invariant comments.
  • Final repair commit test delta: +30/-10 (net +20).
  • Hosted CI repair commit production delta: +37/-22 (net +15), consisting of a type-only companion extraction and the corrected owner request contract.
  • No config/default surface changed.

This is awaiting exact-head hosted CI, Testbox, current ClawSweeper review, and the native maintainer merge workflow.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc vincentkoc self-assigned this Aug 25, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 8, 2026, 10:48 PM ET / September 9, 2026, 02:48 UTC (Revision 7).

ClawSweeper review

What this changes

Returns consolidated subagent results to an active Talk voice session after yielding, with one-shot delivery and revocation when the voice owner changes.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful, distinct fix absent from current main and v2026.9.3. The earlier delivery and ownership findings are addressed, and no blocking introduced defect was found.

Priority: P1
Reviewed head: fa2bf20e148536c1c33dcf3bf12712206bc4a6b9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-level repair with strong final-effect proof and focused regression coverage; no blocking code finding remains.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Supplied exact-head real-provider output exercises the production registration-to-append path: one authorized delayed final and zero sends after duplicate consumption, stale ownership, replacement, cancellation, or claim revocation. Inspected screenshots provide supplemental visible-result evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Supplied exact-head real-provider output exercises the production registration-to-append path: one authorized delayed final and zero sends after duplicate consumption, stale ownership, replacement, cancellation, or claim revocation. Inspected screenshots provide supplemental visible-result evidence.
Evidence reviewed 11 items Current main still lacks the repair: Current main reads only the immediate consult payload and falls back when it contains no speakable text; it has no requester-final attachment module.
Latest release comparison: The inspected v2026.9.3 consult implementation likewise lacks the yielded acknowledgment and delayed-final return path.
Settlement remains authoritative: Registration is promoted only after persistence succeeds. Consumption checks the requester session, exact child batch, generation, and expiry, then removes the attachment before invoking provider output.
Findings None None.
Security None None.

How this fits together

Talk delegates spoken requests to OpenClaw agents while keeping the conversation responsive. After child agents finish, the existing settlement flow synthesizes the answer; this change attaches that answer to the currently authorized voice delegation.

flowchart TD
  A[Spoken request] --> B[Talk consult owner]
  B --> C[Yield and acknowledge]
  C --> D[Child agents settle]
  D --> E[Consolidated requester answer]
  E --> F{Voice owner still authorized?}
  F -->|Yes| G[Append answer once]
  F -->|No| H[Discard voice attachment]
Loading

Before merge

  • Resolve merge risk (P1) - The failing compact-small-19 check remains unclassified because its underlying log host was blocked; this review does not establish green CI.
Agent review details

Security

None.

PR surface

Source +422, Tests +792. Total +1214 across 23 files.

View PR surface stats
Area Files Added Removed Net
Source 13 496 74 +422
Tests 10 869 77 +792
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 1365 151 +1214

Review metrics

Metric Value Why it matters
Production and regression coverage Production +496/-74; tests +869/-77 Production growth implements the cross-layer attachment lifecycle; regression coverage targets persistence ordering, exact ownership, replacement, and duplicate rejection.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep durable requester settlement as the sole completion owner and deliver its answer through a bounded, revocable voice attachment.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep durable requester settlement as the sole completion owner and deliver its answer through a bounded, revocable voice attachment.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: a Talk consult that yields returns before the consolidated child result, while current main only handles its immediate payload. No runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes. Attaching presentation to the existing settled requester answer avoids a competing completion flow and preserves durable delivery independently of voice-session lifetime.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e427f280d961.

Labels

Label justifications:

  • P1: Delegated results currently fail to return through the active voice workflow after the requester yields.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Supplied exact-head real-provider output exercises the production registration-to-append path: one authorized delayed final and zero sends after duplicate consumption, stale ownership, replacement, cancellation, or claim revocation. Inspected screenshots provide supplemental visible-result evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. Supplied exact-head real-provider output exercises the production registration-to-append path: one authorized delayed final and zero sends after duplicate consumption, stale ownership, replacement, cancellation, or claim revocation. Inspected screenshots provide supplemental visible-result evidence.

Evidence

What I checked:

  • Current main still lacks the repair: Current main reads only the immediate consult payload and falls back when it contains no speakable text; it has no requester-final attachment module. (src/talk/agent-consult-runtime.ts:548, e427f280d961)
  • Latest release comparison: The inspected v2026.9.3 consult implementation likewise lacks the yielded acknowledgment and delayed-final return path. (src/talk/agent-consult-runtime.ts, 1391f7cd2d40)
  • Settlement remains authoritative: Registration is promoted only after persistence succeeds. Consumption checks the requester session, exact child batch, generation, and expiry, then removes the attachment before invoking provider output. (src/agents/subagents/requester-final-attachment.ts:136, fa2bf20e1485)
  • Earlier findings addressed: Direct delivery carries committed visible final text; unsuccessful ownership claims revoke promoted attachments. Retained callbacks synchronously assert the current Gateway owner, and close revokes registration before deferred teardown. (src/gateway/talk-client-gateway-control.ts:425, fa2bf20e1485)
  • Re-review continuity: The latest commit extracts controller-local types and corrects the retained-final request type without changing runtime behavior. A local parent-blob read failed; the complete commit patch was instead inspected through GitHub REST. (src/gateway/talk-client-gateway-control.types.ts:11, fa2bf20e1485)
  • Production-boundary proof: The supplied exact-head body records a real provider socket exercising registration, promotion, and consumption: one authorized delayed append, zero duplicate appends, and zero sends after stale ownership, replacement, cancellation, or composed-claim revocation. It also covers synchronous replacement revocation while preserving accepted work. These are supplied observations, not reviewer-executed tests. (fa2bf20e1485)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-08-25T19:26:12.383Z sha db29e2b :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-25T21:22:25.538Z sha db29e2b :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-08T18:05:39.270Z sha db29e2b :: needs real behavior proof before merge. :: [P1] Revoke promoted attachments when requester ownership is rejected
  • reviewed 2026-09-09T00:30:21.374Z sha fe9a06f :: needs real behavior proof before merge. :: [P1] Carry transcript-only requester finals into the voice attachment | [P1] Fence retained final callbacks with the current Talk owner
  • reviewed 2026-09-09T01:47:04.027Z sha 1ef3717 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-09T02:22:13.253Z sha 1ef3717 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the fix/talk-delegation-owner-pr2 branch 4 times, most recently from 99c9bc0 to f17d933 Compare September 7, 2026 15:45
@vincentkoc
vincentkoc force-pushed the fix/talk-delegation-owner-pr2 branch 2 times, most recently from d4b8958 to 68b95a6 Compare September 8, 2026 16:06
Base automatically changed from fix/talk-delegation-owner-pr2 to main September 8, 2026 17:56
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling extensions: openai size: XL labels Sep 8, 2026
@clawsweeper clawsweeper Bot added the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot added maintainer Maintainer-authored PR and removed app: macos App: macos app: web-ui App: web-ui scripts Repository scripts labels Sep 9, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Sep 9, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact-head production-path proof is now recorded in the PR body: one authorized delayed append, duplicate rejection, and zero provider sends after stale ownership, replacement (including the post-acknowledgement deferred-teardown window), cancellation, and composed-claim revocation. The exact-head cropped visual sequence and privacy scan are also complete.

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

vincentkoc commented Sep 9, 2026 •

Copy link
Copy Markdown
Member Author

Exact-head Talk visual proof

Cropped, muted, sanitized sequence at fa2bf20e148536c1c33dcf3bf12712206bc4a6b9. Talk remains responsive while delegated work is pending; the delayed consolidated result appears exactly once and listening remains active.

Before delayed completion After delayed completion
Talk listening before delayed completion Talk listening after one delayed completion

Visual harness: 1/1 passed. Artifact privacy and secret scans: clean.

@vincentkoc
vincentkoc marked this pull request as ready for review September 9, 2026 02:16
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 9, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact-head production-path proof is now recorded in the PR body: one authorized delayed append, duplicate rejection, and zero provider sends after stale ownership, replacement (including the post-acknowledgement deferred-teardown window), cancellation, and composed-claim revocation. The exact-head cropped visual sequence and privacy scan are also complete.

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc merged commit 0151e02 into main Sep 9, 2026
305 of 307 checks passed
@vincentkoc
vincentkoc deleted the fix/talk-subagent-completion-reattach branch September 9, 2026 03:00
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
Return yielded subagent completions to the active Talk session through a revocable, owner-bound callback.

Preserve generation-bound steering and reject duplicate, stale, replaced, or cancelled delivery before provider I/O. Verified with exact-head CI, focused regression coverage, native i18n, a real provider socket, and sanitized visual proof.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling extensions: openai gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant