fix(subagents): make completion handoff review-first · openclaw/openclaw@8040f28
100menotu001
·
2026-05-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -29,6 +29,7 @@ Docs: https://docs.openclaw.ai
|
29 | 29 | - CLI/docs: call the canonical lowercase docs MCP search tool and surface MCP errors instead of returning empty search results. Fixes #82702. (#82704) Thanks @hclsys. |
30 | 30 | - QA-Lab: ignore heartbeat-only operational transcripts when capturing runtime parity cells so background checks cannot replace the scenario reply. (#80323) Thanks @100yenadmin. |
31 | 31 | - Gateway/exec approvals: wait for accepted async approval follow-up runs instead of direct-fallback sending duplicate completions when retries use different nonce keys. Fixes #82711. (#82717) Thanks @udaymanish6. |
| 32 | +- Agents/subagents: mark completed subagent handoffs as ready for parent review so requester agents verify results and continue required follow-up work before reporting done. |
32 | 33 | - CLI/config: add `--dry-run` support to `openclaw config unset`, with `--json` output and allow-exec validation parity with `config set`/`config patch` dry-run handling. (#81895) Thanks @giodl73-repo. |
33 | 34 | - Memory-core: retry disabled dreaming cron cleanup until cron is available after startup, so persisted managed dreaming jobs are removed after restart. Fixes #82383. (#82389) Thanks @neeravmakwana. |
34 | 35 | - Providers/xAI: keep retired Grok 3, Grok 4 Fast, Grok 4.1 Fast, and Grok Code slugs out of model pickers while preserving compatibility resolution for existing configs. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -99,7 +99,9 @@ requester chat when the run finishes.
|
99 | 99 | - `Result` — latest visible `assistant` reply text, otherwise sanitized latest tool/toolResult text. Terminal failed runs do not reuse captured reply text. |
100 | 100 | - `Status` — `completed successfully` / `failed` / `timed out` / `unknown`. |
101 | 101 | - Compact runtime/token stats. |
102 | | -- A delivery instruction telling the requester agent to rewrite in normal assistant voice (not forward raw internal metadata). |
| 102 | +- A review instruction telling the requester agent to verify the result before deciding whether the original task is done. |
| 103 | +- Follow-up guidance telling the requester agent to continue the task or record a follow-up when the child result leaves more action. |
| 104 | +- A final-update instruction for the no-more-action path, written in normal assistant voice without forwarding raw internal metadata. |
103 | 105 | |
104 | 106 | </Accordion> |
105 | 107 | <Accordion title="Modes and ACP runtime"> |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -511,8 +511,13 @@ describe("subagent announce formatting", () => {
|
511 | 511 | expect(msg).toContain("</prompt-data>"); |
512 | 512 | expect(msg).toContain("raw subagent reply"); |
513 | 513 | expect(msg).toContain("Stats:"); |
514 | | -expect(msg).toContain("A completed subagent task is ready for user delivery."); |
515 | | -expect(msg).toContain("Convert the result above into your normal assistant voice"); |
| 514 | +expect(msg).toContain("A completed subagent task is ready for parent review."); |
| 515 | +expect(msg).toContain( |
| 516 | +"Review/verify the result above before deciding whether the original task is done.", |
| 517 | +); |
| 518 | +expect(msg).toContain( |
| 519 | +"If additional action is required, continue the task or record a follow-up; otherwise send a truthful user-facing update.", |
| 520 | +); |
516 | 521 | expect(msg).toContain("Keep this internal context private"); |
517 | 522 | expect(call?.params?.internalEvents?.[0]?.type).toBe("task_completion"); |
518 | 523 | expect(call?.params?.internalEvents?.[0]?.taskLabel).toBe("do thing"); |
@@ -697,7 +702,10 @@ describe("subagent announce formatting", () => {
|
697 | 702 | expect(msg).toContain("tokens 1.0k (in 12 / out 1.0k)"); |
698 | 703 | expect(msg).toContain("prompt/cache 197.0k"); |
699 | 704 | expect(msg).toContain("session_id: child-session-usage"); |
700 | | -expect(msg).toContain("A completed subagent task is ready for user delivery."); |
| 705 | +expect(msg).toContain("A completed subagent task is ready for parent review."); |
| 706 | +expect(msg).toContain( |
| 707 | +"If additional action is required, continue the task or record a follow-up; otherwise send a truthful user-facing update.", |
| 708 | +); |
701 | 709 | expect(msg).toContain( |
702 | 710 | `Reply ONLY: ${SILENT_REPLY_TOKEN} if this exact result was already delivered to the user in this same turn.`, |
703 | 711 | ); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -88,9 +88,9 @@ function buildAnnounceReplyInstruction(params: {
|
88 | 88 | return `Convert this completion into a concise internal orchestration update for your parent agent in your own words. Keep this internal context private (don't mention system/log/stats/session details or announce type). If this result is duplicate or no update is needed, reply ONLY: ${SILENT_REPLY_TOKEN}.`; |
89 | 89 | } |
90 | 90 | if (params.expectsCompletionMessage) { |
91 | | -return `A completed ${params.announceType} is ready for user delivery. Convert the result above into your normal assistant voice and send that user-facing update now. Keep this internal context private (don't mention system/log/stats/session details or announce type).`; |
| 91 | +return `A completed ${params.announceType} is ready for parent review. Review/verify the result above before deciding whether the original task is done. If additional action is required, continue the task or record a follow-up; otherwise send a truthful user-facing update. Keep this internal context private (don't mention system/log/stats/session details or announce type).`; |
92 | 92 | } |
93 | | -return `A completed ${params.announceType} is ready for user delivery. Convert the result above into your normal assistant voice and send that user-facing update now. Keep this internal context private (don't mention system/log/stats/session details or announce type), and do not copy the internal event text verbatim. Reply ONLY: ${SILENT_REPLY_TOKEN} if this exact result was already delivered to the user in this same turn.`; |
| 93 | +return `A completed ${params.announceType} is ready for parent review. Review/verify the result above before deciding whether the original task is done. If additional action is required, continue the task or record a follow-up; otherwise send a truthful user-facing update. Keep this internal context private (don't mention system/log/stats/session details or announce type), and do not copy the internal event text verbatim. Reply ONLY: ${SILENT_REPLY_TOKEN} if this exact result was already delivered to the user in this same turn.`; |
94 | 94 | } |
95 | 95 | |
96 | 96 | function buildAnnounceSteerMessage(events: AgentInternalEvent[]): string { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。