Skip to content

Regression in 1.0.108: deferred MCP function_call loses namespace on the next interaction #5400

Closed

Description

@masra91

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:

  1. Create or resume an SDK session with hosted tool search enabled.
  2. Connect an MCP server with enough/dynamic tools for one to be loaded through deferred tool search.
  3. Have the model discover and invoke a namespaced tool such as sample__agent__sleep.
  4. The MCP tool executes successfully and the interaction completes.
  5. Send another message in the same session.
  6. 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-sdk 1.0.29
  • SDK streaming session
  • MCP tools loaded through hosted/deferred tool search

Workarounds:

Activity

  1. masra91 commented on Nov 9, 2026

    @masra91
    Author

    Closing while I re-evaluate whether this should be tracked in the upstream runtime or mitigated in the host application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions