Skip to content

xAI/Grok requests fail with 'grammar is too complex' when tool payloads are oversized #17405

Closed as not planned

Description

@brendandebeasi

Summary\nGrok requests can fail with grammar is too complex when the outbound tool payload is too large.\n\n## Repro\n- Use xai/grok-4 with a large toolset (many tools and/or large schemas).\n- Invoke opencode run so tools are attached to the request.\n- xAI returns grammar complexity errors.\n\n## Expected\nOpenCode should cap/prune xAI tool payloads before request dispatch so Grok does not receive over-budget grammar payloads.\n\n## Notes\nA pending PR adds hard tool count/payload caps and prunes the final tools map for xAI models.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 13, 2026
  2. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  3. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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