CopilotForXcode icon indicating copy to clipboard operation
CopilotForXcode copied to clipboard

Agent mode is not available

Open iamnanyi opened this issue 5 months ago • 5 comments

Describe the bug When I use Agent mode, no matter which model or input I try, I always get the message: “Sorry, an error occurred while generating a response.” But everything works fine in Ask mode. Interestingly, Agent mode works perfectly in VSCode.

Image

Versions

  • Copilot for Xcode: 0.38.0
  • Xcode: 16.4
  • macOS: 15.5

iamnanyi avatar Jul 17 '25 04:07 iamnanyi

After some troubleshooting, I found that this issue pops up whenever I enable Figma’s official MCP. If I turn it off, I get the error mentioned above. Here’s what the log says: [2025-07-17T05:45:42.510Z] [info] [GitHubCopilot] [10729] window/logMessage: { "type" : 1, "message" : "[fetchChat] Unhandled status from server: 400 {\"error\":{\"message\":\"Invalid 'tools[11].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_\\\\.-]+$'.\",\"code\":\"invalid_value\"}}\n" } [2025-07-17T05:45:42.510Z] [info] [GitHubCopilot] [10729] window/logMessage: { "type" : 4, "message" : "[toolCallingLoop] Processing fetch type: failed in iteration 1 for turn fa441c54-12be-4b45-aee1-b138ff3c364e: {\n \"type\": \"failed\",\n \"reason\": \"unhandled status from server: 400 {\\\"error\\\":{\\\"message\\\":\\\"Invalid 'tools[11].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_\\\\\\\\.-]+$'.\\\",\\\"code\\\":\\\"invalid_value\\\"}}\\n\",\n \"requestId\": \"f291906c-2569-4fb1-886a-094f2709f035\",\n \"code\": 400\n}" }

iamnanyi avatar Jul 17 '25 05:07 iamnanyi

Can I ask what LLM model do you use?

testforstephen avatar Jul 17 '25 05:07 testforstephen

Can I ask what LLM model do you use?

I've tried every model—Claude, GPT, Gemini—you name it. They all throw errors.

iamnanyi avatar Jul 17 '25 06:07 iamnanyi

Invalid 'tools[11].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_\.-]+$'.

It looks like the tool name in figma MCP server does not follow the naming pattern. @iamnanyi Could you share what is the tool name for tools[11].function.name?

// cc: @flytiny

testforstephen avatar Jul 17 '25 06:07 testforstephen

Invalid 'tools[11].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_.-]+$'.

It looks like the tool name in figma MCP server does not follow the naming pattern. @iamnanyi Could you share what is the tool name for tools[11].function.name?

// cc: @flytiny

Image

iamnanyi avatar Jul 17 '25 06:07 iamnanyi