Repository navigation
fix(subagents): a child result committed to the requester transcript is never lost or replayed - #200249
Merged
Conversation
Contributor
|
🦞👀 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. |
…ed, whatever the turn did next A requester wake commits the child result to the parent transcript before the model call. When that turn then failed (for example the provider was overloaded), the row recorded delivery failed with permanent_failure while its own requesterDelivery fact said consumed. Only private completions treated a consumed input as delivered. - Consumed means delivered for every completion. Delete the private and yielded-final exceptions. - A result that never reached the transcript stays owed. Delete the three-attempt limit, the 30s/120s ladder and the exhaustion settle; the sweeper wakes the batch again. - The wake no longer classifies a thrown dispatch error; it records the real reason on the pending batch. Co-authored-by: obviyus <[email protected]>
obviyus
force-pushed
the
obviyus/results-as-state
branch
from
November 16, 2026 20:33
327f1a4 to
6197818
Compare
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
Dispatch and consumption tests now assert the rule instead of the removed attempt limit: unconsumed results stay owed across any number of failed attempts, and a committed result is delivered once, even after a timeout, Stop or cancelled continuation. The announce guide states the same rule. Co-authored-by: obviyus <[email protected]>
… committed result is never replayed A committed child result is delivered when the turn produced no answer, as before. When the requester's answer exists but its channel send failed, the outcome stays a failure with its existing notice path. Either way the committed result settles once; it is never dispatched again. Co-authored-by: obviyus <[email protected]>
…iled before answering A turn that answered or ended for a recorded reason keeps its own outcome, so message-tool and channel send failures keep their notice and suspension paths. Private completions and yielded finals keep their existing rules, and the cleanup check is unchanged. A committed input is still never dispatched again. Co-authored-by: obviyus <[email protected]>
A block carries no turn outcome, so it settles a committed input only by the private rule, as before. Requester-batch tests now cover the real mutation kernel: a committed public result is delivered when its turn failed before answering, and stays failed when its answer missed the channel or the turn ended for a recorded reason. Co-authored-by: obviyus <[email protected]>
Only retryable refusals keep an uncommitted result owed. A permanent refusal, such as a closed-turn transcript rejection, withholds it once with its error and never dispatches it again, as before. The announce guide states both rules. Co-authored-by: obviyus <[email protected]>
…rn itself failed The real provider-outage outcome reached the wake through the direct path with a requester turn-failure reason. Count those reasons as a turn that failed before answering; outbound and recorded-policy reasons keep their outcome. Co-authored-by: obviyus <[email protected]>
…n miss its channel A requester turn that failed (for example on a provider outage) can still report a delivery failure. It has no answer, so its committed result is delivered instead of kept as a missed send. Co-authored-by: obviyus <[email protected]>
…ith no attempt limit Co-authored-by: obviyus <[email protected]>
…delivered, not settled as failed Co-authored-by: obviyus <[email protected]>
Collaborator
Author
|
Landed as b601a4b (head 10cfa70).
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 17, 2026
…is never lost or replayed (openclaw#200249) A requester wake commits the child result to the parent transcript before it calls the model. If that turn then failed (for example a 529), the row recorded delivery=failed/permanent_failure next to its own consumed fact. This affected public results and yielded batches. - A committed result is never dispatched again. If its turn failed before it answered, the result is delivered. A turn that answered but missed its channel keeps its failure. - An uncommitted result stays owed, with no attempt limit, ladder or expiry. - Deletes the private-only and yielded-final consumed exceptions, REQUESTER_SETTLE_WAKE_MAX_ATTEMPTS, the retry ladder, resolveRequesterSettleRetryState and the exhaustion settle. Proof: real Gateway with a real model, base dd40e01 vs head 10cfa70. Provider down 300 s: base failed/permanent_failure, head delivered/consumed while still down, no loop. kill -9 before the wake: delivered after restart. A persistent transcript conflict produced 1 attempt in 6 sweeper ticks. Co-authored-by: Ayaan Zaidi <[email protected]>
This was referenced Nov 18, 2026
This was referenced Nov 18, 2026
RomneyDa
added a commit
that referenced
this pull request
Nov 19, 2026
…is never lost or replayed (#200249) A requester wake commits the child result to the parent transcript before it calls the model. If that turn then failed (for example a 529), the row recorded delivery=failed/permanent_failure next to its own consumed fact. This affected public results and yielded batches. - A committed result is never dispatched again. If its turn failed before it answered, the result is delivered. A turn that answered but missed its channel keeps its failure. - An uncommitted result stays owed, with no attempt limit, ladder or expiry. - Deletes the private-only and yielded-final consumed exceptions, REQUESTER_SETTLE_WAKE_MAX_ATTEMPTS, the retry ladder, resolveRequesterSettleRetryState and the exhaustion settle. Proof: real Gateway with a real model, base 2435c1f vs head 10cfa70. Provider down 300 s: base failed/permanent_failure, head delivered/consumed while still down, no loop. kill -9 before the wake: delivered after restart. A persistent transcript conflict produced 1 attempt in 6 sweeper ticks. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit b601a4b) Release adaptation: clean backport; consumed requester input is terminal without replay, while uncommitted transient failures remain owed. Follow-up audit: no later named #200249 companion through pinned main. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 05d786e06f73efa3aca4b17c33f3074463f3e5d5)
tideclaw-bot
pushed a commit
that referenced
this pull request
Nov 20, 2026
Keep the synthetic provider on loopback despite inherited proxies. Align the post-revocation proof with #200249: a consumed child result remains delivered even when its requester stops before answering. Assert its structured transcript receipt and unchanged history rather than a false delivery-failure notice. Preserve provider cancellation timing, denied effects, Goal state, and revoked subscription checks. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit a1f3553c31ed3c16bf08befe04c831a2964a806d)
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
A requester wake commits the child result to the parent transcript before it calls the model. If that turn then failed (for example the provider returned 529), the subagent row recorded
delivery=failed,disposition=permanent_failure, next to its ownrequesterDelivery: consumedfact. The result was in the parent's transcript, but the row said it was lost.completionTarget: "parent") completions counted a consumed input as delivered.yieldedFinalDeliverablemarker (written on every yielded batch,subagent-registry-requester-yield.ts:580). It was excluded even when its turn failed before it answered, so it settled as a failure.Measured on base
2435c1faa791(real Gateway, real model, provider down for the parent model):delivery=failed disposition=permanent_failure consumed=true(table below).The rule
What this deletes
REQUESTER_SETTLE_WAKE_MAX_ATTEMPTS, the retry-delay ladder,resolveRequesterSettleRetryStateand the exhaustion settle.No storage, schema or protocol change, and no new module. Production code: +57 / −69 (−12). The additions are the turn-failed-before-answer rule (
subagent-delivery-state.ts) and the missed-channel marker on the direct response.What triggers a retry, and why it cannot spin
subagent-registry-sweeper.ts) and the Gateway restart restore.delivered, child input in the transcript once.E2E (real Gateway from source,
claude-opus-5-5parent andclaude-sonnet-5-5child via cliproxy; a local proxy returns 529 for the parent model while "down"; isolated state, service env stripped, unique random ports)2435c1faa79110cfa70da2b2delivery=failed disposition=permanent_failure consumed=true. 7 refused requests, all within 62 s of the wake.delivery=delivered consumed=truewhile still down. 7 refused requests, all within 67 s of the wake, then 0 for the remaining ~4 min. No "couldn't be delivered".parent-got child-final …kill -9the Gateway after the child ended and before the wake (parent busy)pending→ after restartdelivered consumed=true; the parent replies with the child resultpendingsurvives the kill → Gateway back in ~45 s →delivered consumed=true; the parent repliesparent-got child-final …~2 min after restart, once, with no duplicateAn intermediate head (
39e5a58, production identical toab9ab16) still showedfailed/permanent_failureon the provider-down journey, the same as base. That run found the yielded-marker exception fixed in10cfa70.Tests:
subagent-requester-delivery.test.tsadds yielded private finals ("failed before answering" → delivered, red before the fix; "missed its channel" → failed).server.subagent-transcript-conflict.test.tsnow pins the new contract: a conflicted, uncommitted result stays owed and is due at once, and the 4th wake after 3 conflicts delivers it.Local ClawSweeper review (
gpt-6.1-sol, normal speed) of10cfa70: patch is correct, 0 findings. Its maintainer question ("retry indefinitely without the attempt budget?") is answered by the class rule above: no attempts, ladders or expiry. The cost of retrying is bounded by the probe and the outage counts.CI: the earlier red
checks-node-changed-*jobs were[MISSING_EXPORT] resolveIdentityPathViaExistingAncestorfrommain(the same failure on #200247: https://github.com/openclaw/openclaw/actions/runs/43948463342/job/133585463142), fixed by #200242. The later redserver.subagent-transcript-conflict.test.tsasserted the deleted ladder and was updated in39e5a58.Follow-ups (same class, separate PRs):
/newbefore a pending result is consumed shows that result in the fresh conversation's runtime context; and "subagent source lifecycle changed before completion delivery" drops a finished result when the parent's run has moved on.