chore: document sessions_spawn response note and subagent context prefix

This commit is contained in:
Tyler Yust
2026-02-17 11:05:37 -08:00
parent ab94295541
commit 2362aac3db
3 changed files with 12 additions and 1 deletions

View File

@@ -6,6 +6,8 @@ Docs: https://docs.openclaw.ai
### Changes ### Changes
- Agents/Subagents: add an accepted response note for `sessions_spawn` explaining polling subagents are disabled for one-off calls.
- Agents/Subagents: prefix spawned subagent task messages with context to preserve source information in downstream handling.
- iOS/Talk: add a `Background Listening` toggle that keeps Talk Mode active while the app is backgrounded (off by default for battery safety). Thanks @zeulewan. - iOS/Talk: add a `Background Listening` toggle that keeps Talk Mode active while the app is backgrounded (off by default for battery safety). Thanks @zeulewan.
- iOS/Talk: harden barge-in behavior by disabling interrupt-on-speech when output route is built-in speaker/receiver, reducing false interruptions from local TTS bleed-through. Thanks @zeulewan. - iOS/Talk: harden barge-in behavior by disabling interrupt-on-speech when output route is built-in speaker/receiver, reducing false interruptions from local TTS bleed-through. Thanks @zeulewan.
- iOS/Talk: add a `Voice Directive Hint` toggle for Talk Mode prompts so users can disable ElevenLabs voice-switching instructions to save tokens when not needed. (#18250) Thanks @zeulewan. - iOS/Talk: add a `Voice Directive Hint` toggle for Talk Mode prompts so users can disable ElevenLabs voice-switching instructions to save tokens when not needed. (#18250) Thanks @zeulewan.

View File

@@ -83,6 +83,7 @@ describe("openclaw-tools: subagents (sessions_spawn model + thinking)", () => {
}); });
expect(result.details).toMatchObject({ expect(result.details).toMatchObject({
status: "accepted", status: "accepted",
note: "auto-announces on completion, do not poll",
modelApplied: true, modelApplied: true,
}); });

View File

@@ -39,10 +39,13 @@ export type SpawnSubagentContext = {
requesterAgentIdOverride?: string; requesterAgentIdOverride?: string;
}; };
export const SUBAGENT_SPAWN_ACCEPTED_NOTE = "auto-announces on completion, do not poll";
export type SpawnSubagentResult = { export type SpawnSubagentResult = {
status: "accepted" | "forbidden" | "error"; status: "accepted" | "forbidden" | "error";
childSessionKey?: string; childSessionKey?: string;
runId?: string; runId?: string;
note?: string;
modelApplied?: boolean; modelApplied?: boolean;
warning?: string; warning?: string;
error?: string; error?: string;
@@ -258,6 +261,10 @@ export async function spawnSubagentDirect(
childDepth, childDepth,
maxSpawnDepth, maxSpawnDepth,
}); });
const childTaskMessage = [
`[Subagent Context] You are running as a subagent (depth ${childDepth}/${maxSpawnDepth}). Results auto-announce to your requester; do not busy-poll for status.`,
`[Subagent Task]: ${task}`,
].join("\n\n");
const childIdem = crypto.randomUUID(); const childIdem = crypto.randomUUID();
let childRunId: string = childIdem; let childRunId: string = childIdem;
@@ -265,7 +272,7 @@ export async function spawnSubagentDirect(
const response = await callGateway<{ runId: string }>({ const response = await callGateway<{ runId: string }>({
method: "agent", method: "agent",
params: { params: {
message: task, message: childTaskMessage,
sessionKey: childSessionKey, sessionKey: childSessionKey,
channel: requesterOrigin?.channel, channel: requesterOrigin?.channel,
to: requesterOrigin?.to ?? undefined, to: requesterOrigin?.to ?? undefined,
@@ -316,6 +323,7 @@ export async function spawnSubagentDirect(
status: "accepted", status: "accepted",
childSessionKey, childSessionKey,
runId: childRunId, runId: childRunId,
note: SUBAGENT_SPAWN_ACCEPTED_NOTE,
modelApplied: resolvedModel ? modelApplied : undefined, modelApplied: resolvedModel ? modelApplied : undefined,
warning: modelWarning, warning: modelWarning,
}; };