Repository navigation
Description
Describe the bug
Copilot CLI 1.0.108 can permanently break an SDK-hosted session after a deferred MCP tool call. The tool call succeeds, but the first request in the next interaction fails with:
400 Missing namespace for function_call 'sample-sample__agent__sleep'.
It does not exist in the default namespace. Round-trip the model's
function_call item with its namespace field included.
Every later request in that session fails with the same error. Starting a new conversation is the only recovery I found.
This appears to be a regression of #4519, which was reported fixed in 1.0.91.
Affected version
Copilot CLI 1.0.108, hosted through @github/copilot-sdk 1.0.29.
Steps to reproduce the behavior
The following is the observed sequence with synthetic tool and server names:
- Create or resume an SDK session with hosted tool search enabled.
- Connect an MCP server with enough/dynamic tools for one to be loaded through deferred tool search.
- Have the model discover and invoke a namespaced tool such as
sample__agent__sleep. - The MCP tool executes successfully and the interaction completes.
- Send another message in the same session.
- The request fails with the missing-namespace 400 above. Retrying any prompt continues to fail.
The tool list changed after the successful call in the observed case. That may be the trigger for replay failing to infer the old namespace, but I have not independently proven that condition with a standalone synthetic MCP server.
Expected behavior
The runtime should preserve or reconstruct the namespace when replaying the prior function_call, allowing the next interaction to continue normally.
Additional context
Sanitized persisted-event evidence:
{
"toolRequest": {
"name": "sample-sample__agent__sleep",
"toolCallId": "call_example",
"mcpServerName": "sample",
"mcpToolName": "sample__agent__sleep"
},
"serverTools": {
"functionCallNamespaces": {
"call_example": "sample"
}
}
}The persisted toolRequest has no namespace, while the same event retains the correct call-ID-to-namespace mapping. The tool completes successfully. The next interaction immediately receives invalid_request_body / HTTP 400, and all subsequent interactions repeat it.
This suggests the replay path is not reattaching serverTools.functionCallNamespaces[toolCallId] to the serialized Responses API function_call.
Environment:
- macOS, arm64
- Copilot CLI 1.0.108
@github/copilot-sdk1.0.29- SDK streaming session
- MCP tools loaded through hosted/deferred tool search
Workarounds:
- Start a new conversation to recover the already-broken session.
- Disabling tool search (
"toolSearch": false) before starting a new session was the workaround documented in 400 "Missing namespace for function_call" for deferred/tool-search tools (e.g. extensions_manage) on 1.0.80 #4519. It avoids deferred namespaces but increases the initially loaded tool set.
Activity
masra91 commentedon Nov 9, 2026
Closing while I re-evaluate whether this should be tracked in the upstream runtime or mitigated in the host application.