Merge PR #3927: fix(agent): reject stale yield labels for override schemas (@roboomp)

This commit is contained in:
can1357
2026-07-01 21:50:54 +02:00
9 changed files with 187 additions and 11 deletions
@@ -295,6 +295,11 @@ export interface ExecutorOptions {
parentActiveModelPattern?: string;
thinkingLevel?: ThinkingLevel;
outputSchema?: unknown;
/**
* Caller supplied a schema that supersedes the agent's native output prompt.
* Eval `agent(..., schema=...)` sets this so built-in agents ignore stale yield labels.
*/
outputSchemaOverridesAgent?: boolean;
/** Parent task recursion depth (0 = top-level, 1 = first child, etc.) */
taskDepth?: number;
/**
@@ -2139,6 +2144,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
planReferencePath: options.planReference?.path ?? "",
worktree: worktree ?? "",
outputSchema: normalizedOutputSchema,
outputSchemaOverridesAgent: options.outputSchemaOverridesAgent === true,
ircPeers: ircEnabled ? renderIrcPeerRoster(id) : "",
ircSelfId: ircEnabled ? id : "",
});