Skip to content

feat(subagents): replace silent boolean with announce enum ('user'|'parent'|'skip') - #13303

Closed
ivalsaraj wants to merge 20 commits into
openclaw:mainfrom
ivalsaraj:extend-8393-announce-enum
Closed

ivalsaraj wants to merge 20 commits into
openclaw:mainfrom
ivalsaraj:extend-8393-announce-enum

Conversation

@ivalsaraj

@ivalsaraj ivalsaraj commented Feb 10, 2026 •

Copy link
Copy Markdown

Extends #8393 by @Glucksberg. Closes #12730.

What

Replaces the silent: boolean parameter with a more flexible announce enum on sessions_spawn, enabling orchestrator patterns where the parent agent can intercept sub-agent results before they reach the user.

New API:

sessions_spawn({
  task: "...",
  announce: "user" | "parent" | "skip"  // default: "user"
})

Config:

{ agents: { defaults: { subagents: { announce: "user" | "parent" | "skip" } } } }

Modes

  • "user" (default) — Current behavior. Announce posts directly to requester chat channel.
  • "skip" — Suppresses announce entirely. Cleanup still runs. (Replaces silent: true from feat(subagents): add config option to suppress announce messages (#8299) #8393.)
  • "parent" — New. Injects the announce result as a system event into the spawning (parent) session. Parent agent wakes up and can review/filter/summarize before relaying to the user.

Why

Sub-agents currently announce directly to the user, bypassing the parent agent entirely. This makes orchestrator patterns impossible — the parent can't review, gate, or consolidate results from multiple sub-agents before surfacing them.

The "parent" mode enables:

  • Orchestrator spawns 5 sub-agents → reviews all results → sends one curated summary
  • Quality gating — parent filters out low-quality or failed sub-agent output
  • Context building — parent aggregates sub-agent findings before responding

Changes

File What
sessions-spawn-tool.ts Added announce param to tool schema
subagent-announce.ts Core "parent" mode: system event injection + parent wake
subagent-registry.ts announce field in run records
subagent-registry.store.ts Persistence for announce mode
types.agent-defaults.ts Config type
zod-schema.agent-defaults.ts Zod validation
subagents.md Docs (new param, mode examples, system event format)
3 test files Tests for all three modes + cleanup behavior

Implementation notes

Parent mode flow:

  1. Sub-agent completes → runSubagentAnnounceFlow checks announce mode
  2. announce: "parent" → format result as system event (status, summary, session key, stats)
  3. Inject into parent session via enqueueSystemEvent()
  4. Trigger parent wake via non-delivered agent turn
  5. Cleanup (label patch, session deletion) runs normally

Design decisions:

Testing

  • pnpm build ✅
  • pnpm check (oxlint) — 0 warnings, 0 errors ✅
  • Unit tests for all three announce modes ✅
  • Cleanup behavior tests ✅
  • Integration test on live gateway (not tested — would appreciate help validating the "parent" path end-to-end)

AI disclosure

Built with AI assistance (OpenClaw + GPT-5.3 Codex + Claude Opus). Focused tests written and passing. Full build and lint validated.

Co-authored-by: @Glucksberg (base implementation from #8393)

Greptile Overview

Greptile Summary

This PR replaces the prior boolean-style sub-agent announce control with an explicit announce routing mode (user | parent | skip) on sessions_spawn, plus a matching agents.defaults.subagents.announce config default.

Core behavior is implemented in src/agents/subagent-announce.ts: user preserves existing behavior (requester-facing announce), skip suppresses delivery while still allowing cleanup, and parent injects a system event into the parent session via enqueueSystemEvent() and wakes the parent agent via a non-delivered agent call (deliver: false). The announce mode is persisted on subagent run records, and tests/docs are updated to cover the new modes and persistence.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • I reviewed the changed implementation and surrounding integration points (tool schema wiring, announce flow, persistence load/save, and config schema). The new announce modes are consistently plumbed through sessions_spawn -> registry -> announce flow, and tests cover user, parent, and skip behaviors including cleanup semantics.
  • No files require special attention.

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

…sages (openclaw#8299)

Add agents.defaults.subagents.suppressAnnounce (boolean, default false) to
globally suppress sub-agent completion announcements to the parent session.

Also add a per-spawn 'silent' parameter to sessions_spawn tool, allowing
individual spawns to override the global setting. The per-spawn flag takes
precedence over the global config.

When suppressed, the announce message is skipped but cleanup (label patching,
session deletion) still runs normally via the finally block.

Config example:
  agents:
    defaults:
      subagents:
        suppressAnnounce: true

Per-spawn example:
  sessions_spawn({ task: '...', silent: true })

Closes openclaw#8299
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling labels Feb 10, 2026
@ivalsaraj
ivalsaraj force-pushed the extend-8393-announce-enum branch from 71bb7ac to 5a0be93 Compare February 10, 2026 09:56
…arent'|'skip')

Refactor the sub-agent announce system:
- Replace silent:boolean with announce:'user'|'parent'|'skip' enum
- Add 'parent' mode: injects result as system event into spawning session
- Add parent session wakeup on sub-agent completion
- Global config: agents.defaults.subagents.announce
- Per-spawn override via sessions_spawn announce param
- Update tests and documentation

Co-authored-by: Glucksberg <[email protected]>
Co-authored-by: Valsaraj R <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations channel: feishu Channel integration: feishu labels Feb 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord and removed channel: feishu Channel integration: feishu labels Feb 19, 2026
@openclaw-barnacle openclaw-barnacle Bot removed channel: discord Channel integration: discord cli CLI command changes commands Command implementations labels Feb 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Feb 22, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the app: web-ui App: web-ui label Feb 22, 2026
@joanproductivo

Copy link
Copy Markdown

Do you know if this feature will ever be added? Thanks

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Mar 10, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #pr-thunderdome-dangerzone on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

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 size: M stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Sub-agent announce routing to parent session (orchestrator pattern)

3 participants