Skip to content

tool_call.arguments truncated to exactly 214 chars on Ollama Cloud API #15647

Open

Description

@ruhtraxjj

Bug Description
When using models via the Ollama Cloud API (https://ollama.com/v1), tool_call.function.arguments is truncated to exactly 214 characters.
This produces invalid JSON that causes HTTP 400: invalid tool call
arguments on subsequent API calls that include the truncated
arguments in conversation history.

Steps to Reproduce

  1. Call POST /v1/chat/completions with glm-5.1 (or qwen3.5) and tool definitions
  2. In a multi-turn conversation where the model generates tool calls
    with arguments > 214 chars 3. The returned tool_call.function.arguments is truncated to exactly
    214 characters 4. Sending the conversation history (including the truncated args)
    back to the API returns 400: invalid tool call arguments
    Evidence
    Across 35+ error instances, every single invalid arguments field is exactly 214 characters long, strongly suggesting a server-side buffer or limit:

All 46 invalid tool_calls: 214 chars (100%)

Examples of truncated arguments:

  • {"code":"from hermes_tools import terminal\n\nrepos = [\n
    ("alexpate/awesome-design-systems"... → truncated mid-string - {"command":"cd ~/design-md && for d in */; do echo "${d%/}"; done
    | sort > /tmp/... → truncated mid-command - {"path":"/home/emma/北雅英语/BEIYA-DESIGN-WORKFLOW.md","content":"# 北雅 AI 设计... → truncated mid-content
    Expected Behavior
    tool_call.function.arguments should contain complete, valid JSON regardless of length. If there is a length limit, the model should be constrained to produce arguments within that limit, or the API
    should return an error rather than silently truncating.

Environment

Activity

  1. PureBlissAK commented on Apr 18, 2026

    @PureBlissAK

    🤖 Automated Triage & Analysis Report

    Issue: #15647
    Analyzed: 2026-04-18T18:13:50.898637

    Analysis

    • Type: unknown
    • Severity: medium
    • Components: unknown

    Implementation Plan

    • Effort: medium
    • Steps:

    This issue has been triaged and marked for implementation.

  2. horendus commented on Apr 21, 2026

    @horendus

    Solid analysis by the bot

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions