Skip to content

fix: subagent results stop returning after a follow-up - #168068

Merged
roboclaw-bot merged 2 commits into
mainfrom
openclaw/diagnosing-a-subagent-error
Oct 10, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
openclaw/diagnosing-a-subagent-error

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #162761
Related: #167047 — @Oldrich333’s existing owner-only proposal. This repair covers named operators as well, without adding an owner exception or changing that contributor’s branch.

What Problem This Solves

Fixes successful subagent results failing to return when the requester sends a follow-up while the parent is waiting.

User Impact

Users can continue the conversation without losing accepted child results. Results retain the original caller’s permissions; real source revocation, reset, cancellation, and foreign-requester protections remain enforced. No configuration or storage migration is required. This does not replay historical failed deliveries or deploy to a running Gateway.

Why This Change Was Made

The automation-management handoff also retained a second copy of general operator authority. A new user turn correctly retired automation privileges but inadvertently made that second copy veto result delivery. Remove the duplicate capture, retention, revocation tombstone, and dispatch wrapper: the existing registry completion-custody owner already checks and carries the original source around the actual settle dispatcher. Its fail-closed source checks and tombstones remain intact.

Production diff: +15 / −118 = −103 lines. Tests and documentation are counted separately. The paired regression reuses the existing registry fixture through a coherent sibling support module; no additional Gateway boot, sleep, or polling was added.

Evidence

Final Gateway-effect proof (acee199)

The follow-up now reaches the real in-process Gateway requester continuation and SQLite effects. Only provider inference is mocked; announcement dispatch is not substituted in this fixture. The paired cases reuse the existing suite-level Gateway.

Scenario Original caller/scopes retained Final requester input persisted Execution starts Pending inputs
Same human sends a follow-up; original source remains valid Yes, asserted in the admitted requester Yes 1 0
Same follow-up, then original source revoked while input staging is awaiting Revoked original source is rejected; fresh caller is not borrowed No; transcript unchanged 0 0

The forbidden case also leaves no accepted idempotency entry and no model call. It fails with Original completion source revoked during dispatch, after entering the real input-staging path and before effects.

Revert control: replacing only the production owner with its pre-fix version makes the same-human final-effect case fail with Requester operator authority is no longer current (64.38 s wall). Restoring the fixed owner preserves all six passing cases; production source is byte-identical to the previously reviewed fix.

enforces same-human follow-up after consuming the pause notice and before starting the next turn: passed (1289 ms)
enforces follow-up source revoked during dispatch after consuming the pause notice and before starting the next turn: passed (1394 ms)
Tests: 6 passed (6)

pnpm test src/gateway/server.requester-pause-authority.test.ts --maxWorkers=1: 73.38 s wall. Gateway-server test types, targeted type-aware lint, formatting, line-cap, timeout-race and mock-export checks passed. Fresh P0–P2 autoreview of this test-only addition: scoped-clean. Hosted CI seconds remain pending.

Earlier implementation proof

  • Red/green through real registration, yield transfer, normal same-human chat admission, and requester-settle dispatch: the valid-source case failed before the repair; afterward it delivers under the original source, without restoring old automation management or borrowing a more privileged ambient caller. Revoked original-source delivery is still refused.
  • Seven focused suites: 94/94 tests passed, covering completion custody, automation management, private results, cancellation, reset, mixed sources, and real Gateway pause/continuation effects. Combined pnpm test <seven focused files> --maxWorkers=1 wall time: 239.60 s.
  • After final test extraction and cleanup: 56/56 tests passed in the two directly changed authority suites; command wall 94.75 s. New paired case bodies: 1.377 s / 2.047 s locally. Hosted CI seconds are not yet available. These cases exercise actual persisted registration and source lifetime boundaries, not a mock authorization decision.
  • Independent P0–P2 autoreview of the final candidate: scoped-clean.
  • Full pnpm build: passed, 360.18 s wall. Core production types and all 27 core test typecheck graphs passed. Targeted type-aware lint: 0 warnings, 0 errors. Formatting, line-cap, assertion, SQLite-worker, mock-export, dependency, and other completed guards passed.
  • Historical baseline check failure: the full changed-check command stopped at its unused-export scan (921.60 s wall, including waiting for the build lock). It flags isTelegramReadOnlyControlLaneText in extensions/telegram/src/sequential-key.ts, buildDirectChatContext in src/auto-reply/reply/groups.ts, and the resolveContextTokens re-export in src/auto-reply/reply/model-selection.ts. All three files are unchanged by this patch; inspection of the pinned base shows no external production consumers of those exports (the latter two have test-only consumers). This is not reported as a green full check. Remaining selected static checks were run separately, without suppressing the failed scan. The three baseline exports have since been repaired on main by PR #168048, merged October 10 at 01:18 UTC.

The initial registry proof uses an announcement stub; the final Gateway proof above does not. Both use synthetic identities and isolated state, not a live production conversation. No production state was changed.

Worked on by

Work sessions


View the OpenClaw team session

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: ad538aef-a302-4991-8103-15845deb8dc3
@clawsweeper

clawsweeper Bot commented Oct 10, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: L labels Oct 10, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR lets accepted subagent results return after a requester follow-up while preserving the original caller’s restrictions.

Example: A requester sends “Same human follow-up” while waiting for a child.

  • Before: The completed child cannot resume the requester because the automation handoff reports that operator authority is no longer current.
  • After: The requester receives “Child completed after continuation” under the original completion source; genuine source revocation still prevents execution.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct ownership repair with meaningful final-effect harness evidence; proof remains in-process rather than a shipped user-flow demonstration.
Proof confidence 🦐 gold shrimp (3/6) Sufficient (terminal): The supplied exact-head final-effect harness output addresses the prior authority request: same-human follow-up persists requester input under the original source and starts execution, while revocation during real input staging leaves the transcript unchanged, starts no execution, and leaves no accepted idempotency entry or pending input. The inspected fixture uses synthetic clients and simulated agent execution rather than a live conversation; this is sufficient scoped authority-boundary evidence for the maintainer-authored repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Successful subagent work stops returning when the requester sends another message while waiting.
Reason: The maintainer-authored repair restores the established completion contract without adding configuration, public APIs, or an operator-specific bypass.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a current completion-delivery bug through the existing registry owner, with no actionable findings.

Priority: P1
Reviewed head: acee199156f2511efa0119cf2dd7fe3c2b5c1dcb

Before merge

None.

Findings

None.

Agent review details

How this fits together

The subagent registry retains accepted child results and completion authority, then dispatches a Gateway continuation into the original requester conversation.

flowchart TD
  A[Requester turn] --> B[Accepted child work]
  B --> C[Registry completion custody]
  D[Requester follow-up] --> E[Retire automation handoff]
  C --> F[Validate original live source]
  F --> G[Gateway requester continuation]
  G --> H[Persist input and start execution]
Loading

Technical review

Best possible solution:

Keep completion authorization solely in registry custody while automation management retains its separate turn-revocation contract.

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

Current-main direct-turn admission revokes the automation-owned authority that later vetoes completion; official-release traces corroborate this mechanism, and the supplied revert control fails with the same error.

Is this the best way to solve the issue?

The repair removes the duplicate veto at its owner and preserves original-source restrictions through the existing completion path, avoiding owner exceptions or borrowed permissions.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Requester general-operator capture and dispatch changes intended behavior with a stated reason (bdd47f2: Retain original requester restrictions beyond yield and prevent revoked retries from taking unrestricted dispatch.)
  • Automation-management entitlement lifetime keeps the original intent (3ae3e4d: Allow yielded administrator requesters to manage automations while revoking that handoff on new direct turns, reset, cancellation, and restart.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 3ae3e4d adds src/agents/subagents/requester-cron-authority.ts:173 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3ae3e4dc88ed; files: src/agents/subagents/requester-cron-authority.ts)
  • Vito Cappello: Raw commit 9c5a1c3 adds src/agents/subagents/requester-cron-authority.ts:267 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 9c5a1c3c9cf7; files: src/agents/subagents/requester-cron-authority.ts)

PR surface

Source -103, Tests +237, Docs +3. Total +137 across 6 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 15 118 -103
Tests 4 398 161 +237
Docs 1 4 1 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 417 280 +137

Review metrics

Metric Value Why it matters
Production versus test changes Production +15/-118, net -103; tests/support +398/-161, net +237. Production shrinks by removing duplicate authority ownership; added coverage uses existing registry fixtures and the suite-level Gateway to protect distinct settlement and final-effect boundaries.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #162761
Summary: This PR addresses the canonical follow-up completion failure through registry custody; the other open proposals change overlapping authority behavior.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove merge-risk: 🚨 security-boundary: Current PR review selected no merge-risk labels.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: Official-release reports establish successful child work failing to resume an active requester after ordinary follow-ups.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-10T01:30:53.592Z sha 9bbd28d :: needs real behavior proof before merge. :: none

Reviewed October 9, 2026, 10:28 PM ET / October 10, 2026, 02:28 UTC (Revision 2).

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 6d794c46-c2db-45a4-b16f-af900efcd22b
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 10, 2026 02:22
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: acee199156f2511efa0119cf2dd7fe3c2b5c1dcb
  • Maintainer: @roboclaw-bot
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/subagents/requester-cron-authority.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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: 🚨 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 Oct 10, 2026
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 10, 2026 02:32
@roboclaw-bot
roboclaw-bot merged commit 75510a2 into main Oct 10, 2026
202 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/diagnosing-a-subagent-error branch October 10, 2026 02:34
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
* fix: subagent results stop returning after a follow-up

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: ad538aef-a302-4991-8103-15845deb8dc3

* fix: subagent results stop returning after a follow-up

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 6d794c46-c2db-45a4-b16f-af900efcd22b

---------

Co-authored-by: steipete <[email protected]>
RomneyDa pushed a commit that referenced this pull request Oct 10, 2026
* fix: subagent results stop returning after a follow-up

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: ad538aef-a302-4991-8103-15845deb8dc3

* fix: subagent results stop returning after a follow-up

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 6d794c46-c2db-45a4-b16f-af900efcd22b

---------

Co-authored-by: steipete <[email protected]>
(cherry picked from commit 75510a2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: L 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.

[Bug]: Same-owner followups revoke native subagent completion authority and stall authorized work

1 participant