Skip to content

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

Closed as duplicate

Description

@itse4elhaam

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 29, 2025
  2. github-actions commented on Nov 29, 2025

    @github-actions
    Contributor

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

    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.

  3. rekram1-node commented on Nov 29, 2025

    @rekram1-node
    Contributor

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

  4. rekram1-node commented on Nov 29, 2025

    @rekram1-node
    Contributor

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

  5. itse4elhaam commented on Nov 29, 2025

    @itse4elhaam
    Author

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions