Repository navigation
feat(subagents): add config option to suppress announce messages (#8299) - #8393
Glucksberg wants to merge 2 commits into
Conversation
Additional Comments (1)
This is observable when A simple fix is to distinguish “suppressed” from “failed” (e.g., return a tri-state, or pass a separate Prompt To Fix With AIThis is a comment left during a code review.
Path: src/agents/subagent-registry.ts
Line: 259:262
Comment:
`runSubagentAnnounceFlow()` now returns `false` both when the announce *fails* and when it’s intentionally *suppressed* (via `silent` / config). In `finalizeSubagentCleanup()`, `!didAnnounce` triggers `cleanupHandled=false` to allow retries, which will cause suppressed runs (especially `cleanup:"keep"`) to be retried on every wake/restart and never reach `cleanupCompletedAt`.
This is observable when `silent: true` or `agents.defaults.subagents.suppressAnnounce: true` and `cleanup` is `keep`.
A simple fix is to distinguish “suppressed” from “failed” (e.g., return a tri-state, or pass a separate `suppressed` flag) so suppression is treated as success for cleanup bookkeeping.
How can I resolve this? If you propose a fix, please make it concise. |
f5e0985 to
c620518
Compare
|
Fixed in 994087c9d — |
bfcabea to
30a8f08
Compare
30a8f08 to
86d057e
Compare
7f1d25f to
4c53c16
Compare
|
Nice work on this — the One thing we've been dealing with on our end: we don't just want to suppress announces, we want to route them back to the parent agent so it can act as an orchestrator. Think: parent spawns 5 sub-agents, reviews all their results, then sends one curated summary to the user instead of 5 separate announces flooding the chat. We opened #12730 proposing extending this to an Would be great if the API shape could accommodate this from the start rather than shipping |
|
Thanks for the thoughtful feedback and for opening #12730 — I think the orchestrator pattern is a natural evolution of this. You're right that shipping Here's how I see the implementation mapping to your proposal: API change: // sessions_spawn tool schema
announce?: "user" | "parent" | "skip" // default: "user"
// Global config
agents.defaults.subagents.announce: "user" | "parent" | "skip" // default: "user"Per-spawn What each mode does in
System event payload for Nuances worth discussing:
Estimated scope: ~5 files, mostly the same ones already touched in this PR. The Happy to refactor this PR to use the enum approach. Would you want to co-author the |
4c53c16 to
ef25263
Compare
|
Hey @Glucksberg — we went ahead and built the enum approach based on your proposed architecture. PR is up: #13303 Key decisions:
Your base commits are included (with co-author credit). The One thing we didn't integration test: the actual parent wake behavior on a live gateway. Would be great if you (or the maintainers) could validate that path end-to-end. Happy to iterate on any feedback. |
ef25263 to
714f836
Compare
714f836 to
52db824
Compare
2a16f67 to
92c77ca
Compare
92c77ca to
d7b4b28
Compare
a2f3121 to
a5bb992
Compare
7391148 to
568ad90
Compare
568ad90 to
f97886f
Compare
f97886f to
0d6c0ae
Compare
bfc1ccb to
f92900f
Compare
0d6c0ae to
5e7cc74
Compare
…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
5e7cc74 to
3d0feaf
Compare
|
Closing in favor of #13303, which evolved from the discussion here. @ivalsaraj took the Thanks to everyone who contributed to the design discussion here. |
Fixes #8299
Sub-agent completion announcements can be noisy for internal background tasks.
Changes:
agents.defaults.subagents.suppressAnnounceboolean config option (default: false)silentparameter tosessions_spawntool for per-spawn overridesilenttakes precedence over global configshouldSuppressAnnounce()helper checks both levelssilentthroughSubagentRunRecordand all 3 call sites ofrunSubagentAnnounceFlowUsage:
agents.defaults.subagents.suppressAnnounce: truesessions_spawn({ task: '...', silent: true })Greptile Overview
Greptile Summary
This PR adds a global config (
agents.defaults.subagents.suppressAnnounce) and a per-spawn override (silentonsessions_spawn) to suppress sub-agent completion announcements. Thesilentflag is threaded throughsessions_spawn→registerSubagentRun→runSubagentAnnounceFlow, where announcements are skipped early while still attempting label patching and session deletion infinally. Schema/types were updated to validate the new config option.One issue to watch: the cleanup bookkeeping in
subagent-registrycurrently treatsdidAnnounce=falseas a failure worth retrying. Since suppression also returnsfalse, suppressed runs can get stuck in a retry loop and never mark cleanup complete whencleanup: "keep".Confidence Score: 3/5
didAnnounce=falseis now overloaded to mean both “suppressed” and “failed”, which interacts badly with retry bookkeeping and can cause suppressed runs to be retried indefinitely when cleanup iskeep. That’s a real behavioral regression worth fixing before merge.