Repository navigation
fix: hide subagent announce handoff prompts - #79618
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Current main has a high-confidence source reproduction path through Real behavior proof Next step before merge Security Review detailsBest possible solution: Land a maintainer-approved backend transcript-boundary fix that suppresses only internal subagent completion handoff persistence and keeps history projection filtering as legacy defense in depth. Do we have a high-confidence way to reproduce the issue? Yes. Current main has a high-confidence source reproduction path through Is this the best way to solve the issue? Yes. The proposed direction fixes the persistence boundary and adds a narrow history projection filter for legacy rows, which is safer than a UI-only rendering filter and does not require a new config option. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 8562aa8ab2f3. Re-review progress:
|
b3965a5 to
3bda49c
Compare
* fix: hide subagent announce handoff prompts * chore: update subagent announce changelog entry
* fix: hide subagent announce handoff prompts * chore: update subagent announce changelog entry
* fix: hide subagent announce handoff prompts * chore: update subagent announce changelog entry
…ielding (#314) A parent agent that spawns sub-agents and calls sessions_yield is idle while the children run. When a child finishes, the gateway agent method runs a parent turn with the child result. That turn did not save its prompt to the parent transcript. The model saw the result once, in that turn only. On the next wake the result was gone, so the parent waited for children that had already finished and never sent its final answer. The suppression came from upstream "fix: hide subagent announce handoff prompts" (openclaw#79618). Its goal was to hide the handoff prompt in chat history. The chat display projection already hides user rows with subagent_announce provenance, so dropping the transcript row is not needed for that goal. Upstream removed the same suppression in openclaw#181673. Remove the automatic suppression for sub-agent completion handoffs. The completion turn now saves a user row with inter_session / subagent_announce provenance that carries the child result. Callers that pass suppressPromptPersistence explicitly keep their behavior. Trade-off: when a completion delivery stays pending, for example in a session with no deliverable channel, the agent steering queue replays it on each wake, and a sessions_yield abort returns the leased items to the queue. That replay is now saved in each wake row too. A TODO marks the release on the yield abort; fixing it changes the steering lease rules.
Summary
userturns and could surface[Inter-session message] ... sourceTool=subagent_announceruntime context in Control UI/WebChat history.chat.historyprojection.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
sessions_spawncompletion announce into a requester WebChat session.openai/gpt-5.4-mini, branchrelease/2026.5.7atabffed82d8before and after applying this patch.sessions_spawnwith an isolated child and thensessions_yield, then inspected both raw JSONL transcript messages andchat.history.{ "marker": "CHILD-79071-RELEASE-FIX", "chatSendOk": true, "rawMessageCount": 10, "rawUserCount": 1, "historyCount": 8, "rawUserHasInternalBegin": false, "rawUserHasInterSession": false, "rawUserHasSubagentAnnounce": false, "rawAssistantHasChildToken": true, "historyHasInternalBegin": false, "historyHasInterSession": false, "historyHasSubagentAnnounce": false, "historyAssistantHasChildToken": true, "rawUserSnippets": [], "historySnippets": [] }chat.historycontains the internal announce wrapper.{ "marker": "CHILD-79071-RELEASE-BASE", "chatSendOk": true, "rawMessageCount": 11, "rawUserCount": 2, "historyCount": 9, "rawUserHasInternalBegin": true, "rawUserHasInterSession": true, "rawUserHasSubagentAnnounce": true, "rawAssistantHasChildToken": true, "historyHasInternalBegin": false, "historyHasInterSession": true, "historyHasSubagentAnnounce": true, "historyAssistantHasChildToken": true }Root Cause (if applicable)
usermessage;chat.historythen projected the persisted inter-session wrapper.subagent_announcecompletion handoffs.Regression Test Plan (if applicable)
src/gateway/server-methods/agent.test.ts,src/gateway/session-history-state.test.ts,src/agents/agent-command.live-model-switch.test.ts.src/agents/session-tool-result-guard.test.tsremains adjacent guard coverage for tool result/session handling.User-visible / Behavior Changes
Completed subagent results still appear, but internal
subagent_announcehandoff prompts no longer appear as requester user turns in WebChat history.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
release/2026.5.7atabffed82d8openai/gpt-5.4-minisessions_spawnavailable, OpenAI API key supplied via redacted env fileSteps
release/2026.5.7without this patch and connect over WebSocket.sessions_spawnwith an isolated child and thensessions_yield.chat.historyforsourceTool=subagent_announce/[Inter-session message].Expected
subagent_announceuser prompt after the initial user turn.chat.historyhas no inter-session wrapper row for the subagent announce.Actual
chat.historyexposed the internal announce wrapper.chat.history.Evidence
Human Verification (required)
What I personally verified:
pnpm test src/gateway/server-methods/agent.test.ts src/gateway/session-history-state.test.ts src/agents/agent-command.live-model-switch.test.ts src/agents/session-tool-result-guard.test.tspnpm exec oxfmt --check --threads=1 src/gateway/server-methods/agent.ts src/agents/command/types.ts src/agents/agent-command.ts src/gateway/chat-display-projection.ts src/gateway/server-methods/agent.test.ts src/gateway/session-history-state.test.ts src/agents/agent-command.live-model-switch.test.tspnpm check:changelog-attributionspnpm check:changedin Blacksmith Testbox, run https://github.com/openclaw/openclaw/actions/runs/25589137355chat.history.release/2026.5.7: reproduced before patch, passed after patch.Edge cases checked:
What I did not verify:
pnpm check/ fullpnpm testafter the final rebase.Review Conversations
Compatibility / Migration
Risks and Mitigations
sourceTool=subagent_announceplus subagent task-completion provenance, not all inter-session messages.