fix(mcp): resolve rebase regressions in stream-adapter

Rename intermediateToolCalls → intermediateToolBlocks to match upstream
rename, and pass onElicitation via extraOptions (4th arg) instead of
overrides (3rd arg) in buildSdkOptions test.
This commit is contained in:
Jeremy 2026-04-12 20:09:36 -05:00
parent d4f139c5bf
commit dc489f0a07
2 changed files with 3 additions and 3 deletions

View file

@ -957,10 +957,10 @@ async function pumpSdkMessages(
// (e.g. stop_reason: "tool_use" followed directly by result,
// or a turn with text but no tool execution), the `builder`
// still holds toolCall blocks that were never pushed into
// `intermediateToolCalls`. Fold them in here so they aren't
// `intermediateToolBlocks`. Fold them in here so they aren't
// dropped from the final AssistantMessage.
if (builder) {
mergePendingToolCalls(intermediateToolCalls, builder.message.content);
mergePendingToolCalls(intermediateToolBlocks, builder.message.content);
}
// Add tool calls from intermediate turns first (renders above text)

View file

@ -417,7 +417,7 @@ describe("stream-adapter — session persistence (#2859)", () => {
delete process.env.GSD_WORKFLOW_MCP_ARGS;
delete process.env.GSD_WORKFLOW_MCP_ENV;
delete process.env.GSD_WORKFLOW_MCP_CWD;
const options = buildSdkOptions("claude-sonnet-4-20250514", "test", { onElicitation });
const options = buildSdkOptions("claude-sonnet-4-20250514", "test", undefined, { onElicitation });
assert.equal(options.onElicitation, onElicitation);
} finally {
process.env.GSD_WORKFLOW_MCP_COMMAND = prev.GSD_WORKFLOW_MCP_COMMAND;