Repository navigation
fix(subagents): yielded requests go unanswered after a private subagent completes - #156540
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 1:56 AM ET / 05:56 UTC (Revision 18). ClawSweeper reviewWhat this changesThe PR lets yielded parents answer after private subagents finish while enforcing conversation reply settings, requester identity, intentional silence, and legacy batch privacy. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main still suppresses yielded parents’ automatic replies after private completion. No blocking introduced defect was found, the prior upgrade findings are resolved, and the accepted contract has relevant live proof. Priority: P1 Review scores
Verification
How this fits togetherSubagent settlement returns completed child findings to the requesting agent. The resumed agent’s reply then passes through conversation policy and durable channel delivery. flowchart TD
A[Requester yields] --> B[Persist completion batch]
C[Private child finishes] --> B
B --> D[Check requester and batch authority]
D --> E[Resume parent with private findings]
E --> F[Apply conversation reply policy]
F --> G[Deliver permitted reply]
F --> H[Record intentional silence]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +165, Tests +864, Docs +87, Other +786. Total +1902 across 41 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Use the existing settlement and reply-policy owners to deliver current yielded parents’ answers while keeping private findings and legacy batches confidential. Do we have a high-confidence way to reproduce the issue? Yes: current main makes any batch containing private children parent-only, suppressing automatic parent delivery after yield. The discussion supplies real Telegram reproduction; this read-only review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes: the patch extends existing settlement and reply-policy owners, preserves legacy state, and distinguishes confirmed delivery, intentional silence, failures, and pending continuations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d3fbeaac8fbd. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (17 earlier review cycles; latest 8 shown)
|
Telegram Test Server proof: yielded private subagentReal Telegram DM on Telegram's Test Server, driven by the leased QA user (TDLib recorder), against a fresh Gateway built from each commit. The model is a content-routed mock (source below) so every run takes the same path:
Gateway config patch:
What this proves:
Not covered by this run: the other cases (mixed batches, a replaced requester session, and replaying a batch an older build already tried) are covered by the unit/integration tests in this PR, not by live Telegram. In the Run facts: every cell exited 0 with Command (per cell, from each checkout's root): E2E_ROOT_CONFIG_PATCH='{"tools":{"profile":"coding","codeMode":false,"toolSearch":false}}' \
E2E_MOCK_SERVER_PATH=private-settle-mock.mjs \
E2E_TELEGRAM_MOCK_RESPONSE=OWED_FINAL_OK_7Q # or NO_REPLY \
node .agents/skills/telegram-e2e-userbot/scripts/run-mock-sut-user-e2e.mjs \
--gateway-port <port> --mock-port <port> --dm --timeout-ms 90000 \
--text 'PARENT_ASK_7Q delegate the audit privately, then tell me the result.' \
--record events.ndjson --output summary.jsonMock provider (
|
|
Maintainer decision on the contract change: approved, narrowly. After
Update on This touches subagent completion delivery. It does not change Landing is left to another maintainer. |
Adversarial review — completedReviewed the original Findings
The second repair also accounts for the real delivery path stripping Verification
The PR body contains detailed evidence and measured test costs. The existing live Telegram proof is from |
4cf980c to
67ac0bd
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…ate-settle-owed-reply
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed as 9564dd6. Bug: a parent that yielded on private ( Fix: after a yield, the resumed parent answers under the conversation's normal reply rules (automatic rooms get the final; message-tool-only rooms still need the message tool). Child output stays private, Proof: current-head Telegram Test Server cells (reply policy, reset, and an upgrade from published 2026.9.7) plus focused regressions; ClawSweeper Thanks @roboclaw-bot for the reply-policy and upgrade-path work. |
What Problem This Solves
Fixes: a yielded request can go unanswered after a private subagent completes—or bypass message-tool-only reply settings when the parent resumes.
User Impact
The resumed parent can answer the original conversation under its configured reply policy. Automatic replies deliver normally; message-tool-only conversations keep ordinary final text private. Private child output stays internal, and replaced or reset requester sessions do not receive stale findings.
Why This Change Was Made
Yielding hands completion back to the requester; it does not grant permission to bypass reply policy. The Gateway command path now uses the existing reply-policy owner for the effective resumed run and enforces that policy at delivery, not just in prompts.
Explicit host-owned diagnostics/media retain their existing delivery grants. Suppressed plain finals do not become restart-delivery markers or trigger repeated settle turns. Successful silence, failures, pending work, and confirmed delivery remain distinct. The original requester-identity, cancellation, retry, and previously attempted private-batch protections are preserved.
No configuration, protocol, or database-schema migration is required.
Contributor credit
Original implementation and follow-up fixes by @obviyus. The final reply-policy correction and regression proof were prepared at @obviyus's request, preserving the original PR ancestry and contributor credit.
Work sessions
Evidence
Current integrated candidate
Current head: ba5e732. Main was merged without rewriting the original author history to resolve the paused-child settlement changes. The resolution preserves private completion identity as well as main’s pause notifications and requester-generation fences; prompt snapshots were regenerated through their owner.
src/agents/embedded-agent-runner/run/terminal-resolution.test.ts(1,056 > 1,000 lines), identical to captured main. The earlier coercion-helper failure described below is resolved by this main integration. No lint rule or baseline was weakened.src/gateway/session-activity-summaries.test.ts:981(coveredMessages: expected 3, received 2); matrix fail-fast cancelled unfinished Node lanes. The same unchanged test passed an isolated local probe, but that does not override the repeated CI failure. No timeout, assertion, baseline, or source was weakened, and no waiver or further blind retry is being requested by this proof.Fresh exact-head live proof passed on ba5e732, tree cbb314ffa1515f22934c7e20e54ea34801b861ff, with no source/harness overlay or retry.
All 13 identity gates and the positive-final retention check passed in every cell. There were no private-child leaks, visible NO_REPLY, final edits, duplicate/later finals, or later model requests after settlement+30 seconds. Only model responses were deterministic; Gateway ingress, tools, accepted spawn/yield, child execution, requester settlement, delivery, and TDLib observations were real. Host-owned progress output is allowed; the negative asserts zero FINAL, not total chat silence.
The exact-head build passed in 7m48.2s. The two additional reset/SQLite test files passed all 23 tests in 52.11s. Built entry SHA256: d37c20dc8be2c02e85b3cc0561f103f68991e6818ddcdc9a5a35513faf49dd7c. All three QA finalizers completed; credential scratch, owned processes, listeners, egress bridge and disposable compute were independently verified cleaned up.
Three-cell live receipt · Build and focused checks
The earlier proof below remains historical red-to-green evidence; the current table is a separate exact-committed-head run.
Earlier correction proof
The earlier head c92ae0e leaked one ordinary parent FINAL under messages.visibleReplies=message_tool. The correction was built and exercised with real isolated Gateways, accepted private child spawn/yield/settle flows, Telegram Test Server transport, and a TDLib QA user. Only model responses were deterministic.
All cases verify configuration, message-tool availability, accepted spawn/yield receipts, exact child/requester-settle identities, successful terminal run, and no later final or retry identity. Observation excludes teardown. Host-owned progress/status messages are recorded; the negative proves no FINAL, not total chat silence.
The send-then-NO_REPLY control explicitly uses final:false so the existing message-tool terminal hook permits the later model response. The initial default-final control correctly delivered once and terminated immediately; that fixture mismatch was retained and only the corrected control rerun. The zero-final negative assertion was not weakened.
This earlier live proof used the exact pre-commit candidate bytes on c92ae0e; all 12 source-file hashes in the first correction commit matched that tested candidate. The later main-integration edits are covered separately above. Five hashes identify the live harness; after capture, its offline verdict check was strengthened to reject a final erased by an edit, and an unused mock-helper export was removed without changing its implementation. Existing sanitized timelines independently satisfy that stronger check. Tracked correction patch SHA256: b9c312ff8153f1f9d4f5ca97222206a1dbac1abc61feb3efb87895733efffb20. Committing those unchanged bytes is not presented as a separate live run.
Test cost and earlier evidence
Whole-file wall cost with pnpm test <file> --maxWorkers=1:
These are existing-suite/import costs, not incremental case-only costs. New cases reuse existing fixtures; the long Telegram composition remains opt-in, outside per-PR unit CI. Current-head CI timing is not yet available.
Earlier Telegram proof and original implementation context predates this correction and is not relabeled as current proof.
Current-head live proof (
ce4907a3ba7d)Telegram Test Server, real Gateway and ingress, scripted model, fresh isolated state per cell. Build
distmatches the head.visibleReplies: message_tool, resumed parent writes plain finalmessage, thenNO_REPLY/newwhile the private child is still running/newwhile the marked settle turn is held at the modelintentional_non_delivery, 0 finalsThe yielded-final contract is accepted as a maintainer decision on this PR.