openclaw - ✅(Solved) Fix Bug: parent emits fallback text after subagent spawn instead of remaining silent or returning NO_REPLY [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#69922Fetched 2026-04-22 07:46:39
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1

When a subagent is spawned with sessions_spawn, the parent sometimes emits a user-visible fallback message such as Nothing additional from me. before the child completion arrives.

This was observed and reproduced on Telegram.

Root Cause

When a subagent is spawned with sessions_spawn, the parent sometimes emits a user-visible fallback message such as Nothing additional from me. before the child completion arrives.

This was observed and reproduced on Telegram.

PR fix notes

PR #69942: fix(agents): drop bare NO_REPLY while subagents are pending

Description (problem / solution / changelog)

Closes #69922.

Root cause

When a parent agent spawns a subagent via sessions_spawn, the accepted-spawn system note (src/agents/subagent-spawn-accepted-note.ts) instructs the parent to reply with the silent sentinel NO_REPLY and wait for the child's completion event to carry the actual reply. In direct conversations (e.g. Telegram DMs) the outbound plan in src/infra/outbound/payloads.ts was unaware of the pending-child state. Because the default silent-reply policy for direct surfaces is disallow + rewrite, bare NO_REPLY was getting rewritten into a visible fallback (resolveSilentReplyRewriteText), producing user-visible chatter like Nothing additional from me. in between the spawn and the child completion.

Fix

  • New helper module src/infra/outbound/pending-spawn-query.ts exposes a module-local PendingSpawnedChildrenQuery that callers can register and the outbound plan can consult. It stays a pure module boundary so src/infra/outbound/** keeps its existing architectural position and the public plugin SDK is untouched.
  • createOutboundPayloadPlan accepts an optional hasPendingSpawnedChildren context hint; when omitted it defers to the registered runtime query. When true, bare silent payloads are dropped instead of being rewritten to the fallback text.
  • src/agents/subagent-registry.ts registers a query backed by the existing countActiveRunsForSession(...), so the outbound plan sees real pending subagent runs for the parent session key.

Why this is safe

  • The existing silent-reply policy, SILENT_REPLY_REWRITE_TEXTS, resolveSilentReplySettings, and conversation-type classification are all unchanged. Groups/internal/allow surfaces keep their current behavior.
  • Non-silent payloads are unaffected: the new branch only applies when the payload would already have been classified as a bare silent reply (i.e., there is no visible non-silent content and the silent token is present).
  • The behavior is runtime-enforced via the subagent registry rather than relying on prompt-text compliance from the model.
  • Default hasPendingSpawnedChildren is false/undefined, so callers that don't opt in (including test helpers that construct contexts today) keep their current semantics.
  • No config defaults, schema, help text, or generated artifacts change; no plugin SDK surface changes; no new error codes or gateway protocol changes.

Security / runtime controls that are unchanged

  • resolveSilentReplySettings and the per-surface/per-conversation-type silent reply policy in src/shared/silent-reply-policy.ts.
  • projectOutboundPayloadPlanForDelivery audit logging and the non-silent path through createOutboundPayloadPlan.
  • The subagent-registry lifecycle (restore, retention, cleanup, retry grace).
  • Inbound filtering, internal-context wrapping, and SUBAGENT_SPAWN_ACCEPTED_NOTE remain in place. The new suppression is a safety net that doesn't depend on the note being obeyed.

Tests run

  • pnpm lint:core — 0 warnings, 0 errors.
  • pnpm tsgo — core prod typecheck clean.
  • pnpm check:import-cycles — 0 runtime cycles.
  • pnpm test src/infra/outbound/payloads.test.ts — 30/30 pass, including two new cases that exercise both the explicit hasPendingSpawnedChildren: true context path and the registered runtime query path.
  • pnpm test src/infra/outbound/ — 35 files, 451 tests, all pass.
  • pnpm test src/agents/subagent-registry-cleanup.test.ts src/agents/subagent-registry-completion.test.ts src/agents/subagent-registry-helpers.test.ts src/agents/subagent-registry-lifecycle.test.ts src/agents/subagent-registry-queries.test.ts — all selected registry unit suites pass.
  • pnpm test src/shared/silent-reply-policy.test.ts — 8/8 pass.

The only failures observed locally (subagent-announce.format.e2e.test.ts and subagent-registry.lifecycle-retry-grace.e2e.test.ts) reproduce on origin/main without this change and are unrelated to the outbound-plan path touched here.

AI-assisted PR checklist

  • Marked as AI-assisted here.
  • Degree of testing: fully tested at the changed seam (unit tests for outbound plan, targeted registry suites, typecheck, lint, import cycles).
  • Author understands the code path (silent-reply policy + subagent registry wiring).

Made with Cursor

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • docs/concepts/messages.md (modified, +4/-0)
  • src/agents/subagent-registry.ts (modified, +18/-0)
  • src/infra/outbound/payloads.test.ts (modified, +49/-0)
  • src/infra/outbound/payloads.ts (modified, +16/-1)
  • src/infra/outbound/pending-spawn-query.ts (added, +55/-0)
RAW_BUFFERClick to expand / collapse

Summary

When a subagent is spawned with sessions_spawn, the parent sometimes emits a user-visible fallback message such as Nothing additional from me. before the child completion arrives.

This was observed and reproduced on Telegram.

Expected behavior

  • After sessions_spawn, the parent should remain silent until the child completion event arrives.
  • If the runtime requires an intermediate response, it should emit exactly NO_REPLY.
  • No fallback assistant text should be sent to the user while there is a pending spawned child session.

Actual behavior

  • Immediately after spawning a subagent, the parent sends a visible message like Nothing additional from me..
  • The child later completes normally and the real result is delivered afterwards.
  • This creates noise in user-facing channels and breaks the intended silent-waiting behavior.

Steps to reproduce

  1. Use a channel connected to Telegram.
  2. Send a request that causes the main agent to call sessions_spawn for a subagent.
  3. Ensure the subagent takes a few seconds to complete instead of returning immediately.
  4. Observe the parent response before the subagent completion event arrives.
  5. A fallback message such as Nothing additional from me. is sent to Telegram.
  6. A few seconds later, the subagent completion arrives and the actual answer is delivered.

Why this is a problem

  • It leaks internal orchestration behavior into the user-facing conversation.
  • It adds spurious messages to Telegram.
  • It violates the explicit contract expected by agents that require silence or NO_REPLY while waiting for spawned children.
  • It can confuse users into thinking the interaction already finished.

Suggested fix

  • If there is at least one pending spawned child session, suppress any default fallback assistant message.
  • In code paths where an intermediate response is mandatory, emit exactly NO_REPLY.
  • Make this behavior consistent across chat surfaces, but this issue was specifically verified on Telegram.

Notes

This looks like a fallback/default-response path that does not correctly respect the pending-subagent state.

extent analysis

TL;DR

Suppress default fallback assistant messages when there are pending spawned child sessions to prevent unwanted user-visible responses.

Guidance

  • Review the code paths that handle sessions_spawn and ensure that the parent agent remains silent until the child completion event arrives.
  • Implement a check for pending spawned child sessions before emitting any default fallback messages, and suppress these messages if a child session is pending.
  • Verify that the NO_REPLY response is emitted exactly when an intermediate response is mandatory and a child session is pending.
  • Test the fix on Telegram and other chat surfaces to ensure consistent behavior.

Example

if has_pending_child_session():
    # Suppress default fallback message
    return "NO_REPLY"
else:
    # Emit default fallback message
    return "Nothing additional from me."

Notes

The suggested fix should be applied consistently across all chat surfaces, but the issue was specifically verified on Telegram. The exact implementation details may vary depending on the underlying codebase and architecture.

Recommendation

Apply the suggested workaround by suppressing default fallback assistant messages when there are pending spawned child sessions, as this directly addresses the observed issue and aligns with the expected behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • After sessions_spawn, the parent should remain silent until the child completion event arrives.
  • If the runtime requires an intermediate response, it should emit exactly NO_REPLY.
  • No fallback assistant text should be sent to the user while there is a pending spawned child session.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Bug: parent emits fallback text after subagent spawn instead of remaining silent or returning NO_REPLY [1 pull requests, 1 comments, 2 participants]