Skip to content

fix: hide subagent coordination and stop reply loops - #150625

Merged
steipete merged 4 commits into
mainfrom
codex/subagent-chat-visibility
Sep 17, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/subagent-chat-visibility

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #150488

What Problem This Solves

Worker reports and automatic acknowledgments flood chat, and repeated control markers with an unfinished tail can become a visible final reply.

User Impact

Child coordination stays in agent context and raw transcripts. Chat keeps useful parent answers and task results, including requested results that arrive after the parent finishes waiting. Independent peer reply loops remain available. Historical messages without sender provenance remain visible because their origin cannot be determined safely.

Why This Change Was Made

The existing session owner classifies child traffic from canonical lineage. A child report does not start a reciprocal acknowledgment turn. An ordinary new child turn returns its result inline or delivers it once after the wait expires. Steering, registered task completion, paused-task resume, and isolated scheduled jobs retain their existing completion and announcement owners.

One visibility decision reaches live events, transcript writers, history pages, deltas, and reconnects. Internal guidance can steer a hidden coordination run, while a new human message keeps a visible FIFO turn. Pending-question answers retain their current authority checks. Readonly history workers consume the stores selected and admitted by the host; bounded input lookups preserve incremental history and media.

This integrates the streaming-prefix repair from #150527 and preserves main's immediate-final flush. The remaining control-text case is a completed buffer containing repeated markers and an unfinished tail. The screenshots below compare that case and history against main after #150527. User configuration, SQLite schemas, indexes, migrations, and retention are unchanged. A one-line repair also resolves an inherited CI planner lint failure while preserving its fresh shard copies.

Evidence

  • Exact-head CI passed, including the packaged build and runtime smoke checks. The first GitHub startup attempt created no jobs; one supported close/reopen recovery produced the passing run.
  • The integrated candidate passed 869 routing, steering, display, history, writer, and execution-authority regressions. The full build and bundled asset check passed; fresh independent P2 review found no actionable issues.
  • All 40 native changed-file checks passed, including production/test typing, lint, architecture, and storage guards. The additional CI helper repair passed 217 existing planner tests and a separate clean P2 review.
  • Isolated real OpenAI inference passed hidden and visible child CLI cases, including later turns: four child attempts were rejected and both operator controls succeeded. One late child completion produced exactly one visible parent answer without another child turn. Runtime sources stayed unchanged; the visible-child rerun passed on this exact commit in 49 seconds. The initial combined run had one development-CLI build-lock failure; the failed evidence is retained, and the rerun changed no deadline or assertion.
  • A real SQLite work-counter regression covers plain and compacted history: an early output avoids 2,000 unrelated later inputs, previously inspected ranges are reused, and human answers remain visible.
  • CLI workaround prevention is merged separately in fix: keep subagent reports out of operator CLI messaging #150520.

Synthetic before/after proof uses the production history projector and Gateway event handler. Both human turns and the meaningful parent answer survive. The completed control-reply examples are settled, with no active spinner. All four images were inspected and verified in the originating chat and rendered PR comment.

Scenario Before After
History Before history After history
Completed control reply Before completed control reply After completed control reply

@clawsweeper

clawsweeper Bot commented Sep 17, 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.

@steipete
steipete marked this pull request as ready for review September 17, 2026 05:27
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime commands Command implementations agents Agent runtime and tooling extensions: codex size: XL maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 17, 2026, 6:31 AM ET / 10:31 UTC (Revision 6).

ClawSweeper review

What this changes

The PR hides child-agent coordination from chat while preserving transcripts and useful results, prevents reciprocal acknowledgments, and suppresses completed control-marker fragments.

Merge readiness

⛔ Blocked before merge - 2 items remain

This PR retains meaningful work beyond the related merged fixes. The earlier steering finding is resolved, and the inspected changes do not support carrying forward the generic config/default compatibility blocker. No blocking correctness finding remains.

Priority: P1
Reviewed head: ea7b31509e5c6335f1b0ed3cc9ac5b435dcf099b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent repair with strong visible proof, substantial boundary coverage, and the prior actionable finding resolved.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots demonstrate the production history projector and Gateway handler preserving human answers while removing coordination and settled control fragments. The captured body also reports isolated real-inference late-result delivery; screenshots support the visible behavior, not independent authorization claims.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after screenshots demonstrate the production history projector and Gateway handler preserving human answers while removing coordination and settled control fragments. The captured body also reports isolated real-inference late-result delivery; screenshots support the visible behavior, not independent authorization claims.
Evidence reviewed 10 items Introduced changes and merge ownership: The complete local merge-base-to-head file list supplements the truncated supplied diff. Raw test-merge parent records match the pinned base followed by the pinned PR head; the CI planner edit produces no change against that test merge's main parent.
Distinct work remains on current main: Current main lacks the child-coordination provenance classifier and completed-buffer suppression added here. The supplied merged metadata for #150527 establishes overlapping streaming and routing work, while #150520 addresses the separate CLI workaround. Neither replaces the remaining visibility repair.
Prior steering finding resolved: The visibility mismatch applies only to inbound human messages. The complete sessions_send steering regression exercises the active session queue and persisted provenance, including a hidden run. The author's disposition is recorded at #150625 (comment).
Findings None None.
Security None None.

How this fits together

Session messaging routes requests between OpenClaw agents and manages their replies. Shared transcript and Gateway display owners preserve internal context while deciding what appears in chat, history, and reconnects.

flowchart TD
  A[Session message] --> B[Canonical sender lineage]
  B --> C[Reply and turn owner]
  C --> D[Raw transcript]
  C --> E[Shared visibility policy]
  D --> E
  E --> F[Live chat and history]
  C --> G[Requested result delivery]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth Production/tooling net +1,062 lines; tests/support net +2,799 lines The production growth supports shared visibility and admitted history readers, with regression coverage across routing, persistence, and display.
Configuration and storage surface 1 optional provenance field; 0 new user settings; 0 SQL schema changes The compatibility-sensitive change is message classification, not a new configuration default or database migration.

Stored data model

Persistent data-model change detected: serialized state: src/gateway/session-utils-store-selection.ts, unknown-data-model-change: src/gateway/session-utils-store-selection.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #150488
Summary: This PR is the candidate for the remaining coordination-visibility work; the merged related repairs cover overlapping or adjacent paths.

Members:

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

Technical review

Best possible solution:

Keep one lineage-based coordination policy across delivery, transcript writers, and chat projections, while preserving visible human answers and existing completion ownership.

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

Yes, from source and supplied evidence: current main lacks coordination filtering and completed-buffer handling for repeated markers with a partial tail. This review inspected the corresponding regressions and screenshots without executing target code.

Is this the best way to solve the issue?

Yes. The patch extends existing lineage, reply, transcript, and display owners; inspected controls preserve independent peers, requested late results, human follow-ups, and unattributed history.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The linked report establishes disruptive worker chatter, reciprocal turns, and leaked control text during active multi-agent workflows.
  • 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 (screenshot): Inspected before/after screenshots demonstrate the production history projector and Gateway handler preserving human answers while removing coordination and settled control fragments. The captured body also reports isolated real-inference late-result delivery; screenshots support the visible behavior, not independent authorization claims.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots demonstrate the production history projector and Gateway handler preserving human answers while removing coordination and settled control fragments. The captured body also reports isolated real-inference late-result delivery; screenshots support the visible behavior, not independent authorization claims.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots demonstrate the production history projector and Gateway handler preserving human answers while removing coordination and settled control fragments. The captured body also reports isolated real-inference late-result delivery; screenshots support the visible behavior, not independent authorization claims.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • weiqinl: 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 (5 earlier review cycles)
  • reviewed 2026-09-17T05:39:21.002Z sha 6fc71cc :: blocked before merge. :: [P2] Allow internal steering into hidden coordination runs
  • reviewed 2026-09-17T06:39:10.699Z sha a709bb6 :: blocked before merge. :: [P2] Allow internal steering into hidden coordination runs
  • reviewed 2026-09-17T07:02:24.310Z sha 08ca78e :: blocked before merge. :: none
  • reviewed 2026-09-17T10:03:56.767Z sha ea7b315 :: blocked before merge. :: none
  • reviewed 2026-09-17T10:11:30.448Z sha ea7b315 :: blocked before merge. :: none

@steipete
steipete force-pushed the codex/subagent-chat-visibility branch from 6fc71cc to c8957ab Compare September 17, 2026 06:22
@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack plugin: workboard labels Sep 17, 2026
Keep child reports and their automatic coordination turns out of chat while
preserving raw transcripts, useful parent answers, and independent peer replies.
Deliver requested late child results once through the existing completion path.

Use canonical source lineage consistently during live admission and history
projection, preserve human followups and pending-question ownership, and clear
streamed control-marker fragments when their output becomes suppressed.

Closes #150488
Keep host acquisition outside admitted history readers while sharing canonical
row selection, ACP metadata reads, and subagent depth policy through leaf modules.

Filter control-only commentary fallbacks before sanitizing them into empty rows,
retain structured and transcript media, and preserve history cursor boundaries.
Move child requester coverage to the one-way matrix and regenerate the Workboard
asset manifest affected by the provenance schema change.
@steipete
steipete force-pushed the codex/subagent-chat-visibility branch from c8957ab to a709bb6 Compare September 17, 2026 06:28
@openclaw-barnacle openclaw-barnacle Bot removed the channel: slack Channel integration: slack label Sep 17, 2026
Apply the visibility mismatch guard only to new inbound user turns. Internal
guidance can steer its active owner, while human messages still receive visible
FIFO followups and pending questions retain their existing authority checks.

Restore ordinary injection-target discovery and exercise the real sessions_send
queue and transcript path alongside the existing steering controls.
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the internal-steering finding in 08ca78e0d7c8. The visibility guard now applies only to inbound human turns. Internal guidance retains the active run's output owner; final human admission still preserves visible FIFO followups and the existing pending-question authority checks. The obsolete question-only discovery exception was removed.

The entry-point regression exercises sessions_send(mode="steer"), a running agent session, queue admission, and transcript persistence. With the original guard, the four existing controls passed and the new hidden-run case failed with input_visibility_mismatch; all five pass with the fix. All 163 focused steering, human, question, and authority cases passed, as did the changed-file gate and fresh independent P2 review. The steering table now lives in src/agents/openclaw-tools.sessions-steering.test.ts.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 17, 2026
Keep child reports one-way and preserve one useful late result for ordinary
child follow-ups. Isolated Cron requesters retain target announcements without
receiving automatic reply or failure turns.

Preserve the current main terminal-flush repair and exec authority at worker
handoff while retaining canonical history ownership and hidden coordination.

Repair an inherited CI planner lint failure while preserving fresh shard copies.
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 17, 2026
@steipete steipete closed this Sep 17, 2026
@steipete steipete reopened this Sep 17, 2026
@steipete
steipete merged commit 623f22c into main Sep 17, 2026
238 checks passed
@steipete
steipete deleted the codex/subagent-chat-visibility branch September 17, 2026 10:34
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
* fix: hide subagent coordination and stop reply loops

Keep child reports and their automatic coordination turns out of chat while
preserving raw transcripts, useful parent answers, and independent peer replies.
Deliver requested late child results once through the existing completion path.

Use canonical source lineage consistently during live admission and history
projection, preserve human followups and pending-question ownership, and clear
streamed control-marker fragments when their output becomes suppressed.

Closes openclaw#150488

* fix: preserve history reader isolation and cursor boundaries

Keep host acquisition outside admitted history readers while sharing canonical
row selection, ACP metadata reads, and subagent depth policy through leaf modules.

Filter control-only commentary fallbacks before sanitizing them into empty rows,
retain structured and transcript media, and preserve history cursor boundaries.
Move child requester coverage to the one-way matrix and regenerate the Workboard
asset manifest affected by the provenance schema change.

* fix: allow internal steering during hidden coordination

Apply the visibility mismatch guard only to new inbound user turns. Internal
guidance can steer its active owner, while human messages still receive visible
FIFO followups and pending questions retain their existing authority checks.

Restore ordinary injection-target discovery and exercise the real sessions_send
queue and transcript path alongside the existing steering controls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui commands Command implementations docs Improvements or additions to documentation extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. plugin: workboard proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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.

Subagent coordination leaks into chat and triggers peer reply loops

1 participant