Skip to content

[cherry-pick] Fix tool_search bookkeeping when resuming from stateful marker#314231

Merged
dmitrivMS merged 1 commit into
release/1.119from
cherry-pick/314217
May 4, 2026
Merged

[cherry-pick] Fix tool_search bookkeeping when resuming from stateful marker#314231
dmitrivMS merged 1 commit into
release/1.119from
cherry-pick/314217

Conversation

@vs-code-engineering
Copy link
Copy Markdown
Contributor

Cherry-pick of #314217 from main.

Fixes #313899

When resuming from a Responses API previous_response_id, the assistant message carrying the stateful marker (and the tool_search_call it emitted) was being sliced out of the input. Bookkeeping (toolSearchCallIds, toolSearchLoadedTools) was populated only while iterating that post-marker slice, so the subsequent tool result was incorrectly serialized as function_call_output instead of tool_search_output, leaving deferred MCP tool definitions unloaded on the server. The model would acknowledge the names returned by tool_search but couldn't actually invoke the tool.

Pre-scan the full messages[] for tool_search calls and their results before applying the slice.

Copilot AI review requested due to automatic review settings May 4, 2026 20:59
@vs-code-engineering vs-code-engineering Bot review requested due to automatic review settings May 4, 2026 20:59
@vs-code-engineering vs-code-engineering Bot added the cherry-pick-artifact Auto-generated cherry-pick PR label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

blocks-ci screenshots changed

Replace the contents of test/componentFixtures/blocks-ci-screenshots.md with:

Updated blocks-ci-screenshots.md
<!-- auto-generated by CI — do not edit manually -->

#### editor/codeEditor/CodeEditor/Dark
![screenshot](https://hediet-screenshots.azurewebsites.net/images/cb32a3e854b5734fe5aaca2318f2e0a42ee821b05ea97883ea42c5ba95edb3c3)

#### editor/codeEditor/CodeEditor/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/42624fbba5e0db7f32c224b5eb9c5dd3b08245697ae2e7d2a88be0d7c287129b)

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Dark
![screenshot](https://hediet-screenshots.azurewebsites.net/images/710d77ca0f3926ff2c6c53560aa81942893ffb5a50fae3f3897b6b01ecac9a45)

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/179accfb89a5aeac32979be1da02a9d2269cfe8b8679404c4f6015b1f5998d60)

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Dark
![screenshot](https://hediet-screenshots.azurewebsites.net/images/2fbc12507b59ff950d9612d2df92e6b39d8bf0bf500478e42eca2ead4d1ae206)

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/4632ab04d1fdd7db9ab0e00cce10aefb7a6344eb8869dfce740309a8801cab73)

@dmitrivMS dmitrivMS enabled auto-merge (squash) May 4, 2026 21:05
@dmitrivMS dmitrivMS merged commit 6988d59 into release/1.119 May 4, 2026
25 of 28 checks passed
@dmitrivMS dmitrivMS deleted the cherry-pick/314217 branch May 4, 2026 21:24
@vs-code-engineering vs-code-engineering Bot added this to the 1.119.0 milestone May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-artifact Auto-generated cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants