Error: "Invalid 'tools': array too long" when using Copilot GPT 5.1 #3208

Closed
opened 2026-02-16 17:39:07 -05:00 by yindo · 4 comments
Owner

Originally created by @itse4elhaam on GitHub (Nov 29, 2025).

Description

  • Issue: When using Copilot GPT 5.1, an error occurs:
Invalid 'tools': array too long. Expected an array with maximum length 128, but got an array with length 142 instead.
  • Expected Behavior:
    The system should handle arrays up to the documented maximum length or provide clear guidance to limit array size.

  • Actual Behavior:
    The error is thrown and the workflow fails.

  • Impact:
    Blocks usage of Copilot GPT 5.1.

OpenCode version

1.0.120

Steps to reproduce

  1. Use Copilot GPT 5.1 in OpenCode.
  2. Execute any workflow that initializes the tools array exceeding 128 entries.

Screenshot and/or share link

Image

Operating System

Pop!_OS 22.04 LTS

Terminal

Ghostty

Originally created by @itse4elhaam on GitHub (Nov 29, 2025). ### Description * **Issue:** When using Copilot GPT 5.1, an error occurs: ``` Invalid 'tools': array too long. Expected an array with maximum length 128, but got an array with length 142 instead. ``` * **Expected Behavior:** The system should handle arrays up to the documented maximum length or provide clear guidance to limit array size. * **Actual Behavior:** The error is thrown and the workflow fails. * **Impact:** Blocks usage of Copilot GPT 5.1. ### OpenCode version 1.0.120 ### Steps to reproduce 1. Use Copilot GPT 5.1 in OpenCode. 2. Execute any workflow that initializes the `tools` array exceeding 128 entries. ### Screenshot and/or share link <img width="1905" height="120" alt="Image" src="https://github.com/user-attachments/assets/fbd1b505-3992-4ea8-b4ce-66ff86572049" /> ### Operating System Pop!_OS 22.04 LTS ### Terminal Ghostty
yindo added the opentuibug labels 2026-02-16 17:39:07 -05:00
yindo closed this issue 2026-02-16 17:39:07 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 29, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2513: Implement virtual tools feature to allow GitHub Copilot models to run with more than 128 tools

This is a known limitation where GitHub Copilot models have a maximum of 128 tools, and exceeding this limit causes the 'Invalid tools: array too long' error you're experiencing. The referenced issue proposes implementing a virtual tools concept to automatically activate tools on demand, similar to VSCode's implementation.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 29, 2025): This issue might be a duplicate of existing issues. Please check: - #2513: Implement virtual tools feature to allow GitHub Copilot models to run with more than 128 tools This is a known limitation where GitHub Copilot models have a maximum of 128 tools, and exceeding this limit causes the 'Invalid tools: array too long' error you're experiencing. The referenced issue proposes implementing a virtual tools concept to automatically activate tools on demand, similar to VSCode's implementation. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 29, 2025):

You have one or more mcp servers with a lottt of tools

@rekram1-node commented on GitHub (Nov 29, 2025): You have one or more mcp servers with a lottt of tools
Author
Owner

@rekram1-node commented on GitHub (Nov 29, 2025):

This many tools will degrade llm performance and completely eat up your already limited context window on github copilot

@rekram1-node commented on GitHub (Nov 29, 2025): This many tools will degrade llm performance and completely eat up your already limited context window on github copilot
Author
Owner

@itse4elhaam commented on GitHub (Nov 29, 2025):

This many tools will degrade llm performance and completely eat up your already limited context window on github copilot

Yeah, I was already thinking of it, think this is my sign to fix it 😅

@itse4elhaam commented on GitHub (Nov 29, 2025): > This many tools will degrade llm performance and completely eat up your already limited context window on github copilot Yeah, I was already thinking of it, think this is my sign to fix it 😅
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3208