[BUG] Code mode fails with custom LLM gateway: chat template doesn't support tool calling

Status Open
Maintainer reply None cached
Activity 0 comments · opened Jul 30, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

An API error occurred
Try sending your message again.
API Error: The operation timed out.

failed to parse grammar
Failed to initialize samplers: failed to parse grammar
400: Failed to initialize samplers: failed to parse grammar

no where you can find anything about this. not even claude codes docs website.

What Should Happen?

An API error occurred
Try sending your message again.
API Error: The operation timed out.

failed to parse grammar
Failed to initialize samplers: failed to parse grammar
400: Failed to initialize samplers: failed to parse grammar

no where you can find anything about this. not even claude codes docs website.

Error Messages/Logs

An API error occurred
Try sending your message again.
API Error: The operation timed out.

failed to parse grammar
Failed to initialize samplers: failed to parse grammar
400: Failed to initialize samplers: failed to parse grammar

no where you can find anything about this. not even claude codes docs website.

Steps to Reproduce

An API error occurred
Try sending your message again.
API Error: The operation timed out.

failed to parse grammar
Failed to initialize samplers: failed to parse grammar
400: Failed to initialize samplers: failed to parse grammar

no where you can find anything about this. not even claude codes docs website.

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

ClaudeCode llm-gateway 3rd party configuration

Platform

Other

Operating System

Windows

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗