vllm - 💡(How to fix) Fix [Bug]: Gemma4 on vLLM + PI coding agent: Validation failed for tool "edit": - path: must have required property 'path' [10 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#39072Fetched 2026-04-08 02:52:33
View on GitHub
Comments
10
Participants
3
Timeline
22
Reactions
0
Author
Timeline (top)
commented ×10subscribed ×8mentioned ×3labeled ×1

Error Message

Error Message: Error

Root Cause

Root Cause Analysis: The model is generating syntactically correct code diffs but is failing to adhere to the strict JSON schema constraints of the tool definition. This is likely due to a mismatch between the model's output formatting and the vLLM tool parser, or a lack of emphasis on the path parameter in the system instructions.

Code Example

Validation failed for tool "edit":                                                                                                                                                           
   - path: must have required property 'path'                                                                                                                                                 
                                                                                                                                                                                              
 Received arguments:                                                                                                                                                                          
 {                                                                                                                                                                                            
   "edits": [                                                                                                                                                                                 
     {                                                                                                                                                                                        
       "newText": "<|\"// Supported operators as constants to ensure consistency across lexer, parser, and evaluator.\nconst (\n\tOpAdd    = '+'\n\tOpSub    = '-'\n\tOpMul    = '*'\n\tOpDiv 
 = '/'\n\tOpLParen = '('\n\tOpRParen = ')'\n)\n\n// SupportedFunctions defines the list of built-in functions available in expressions.\nvar SupportedFunctions =                             
 map[string]bool{\n\t\"sqrt\":  true,\n\t\"abs\":   true,\n\t\"floor\": true,\n\t\"ceil\":  true,\n}\n\n// Precision settings could be expanded here if rounding were required.\nconst        
 DefaultPrecision = 64<|\"|",                                                                                                                                                                 
       "oldText": "<|\"// Supported operators as constants to ensure consistency across lexer, parser, and evaluator.\nconst (\n\tOpAdd    = '+'\n\tOpSub    = '-'\n\tOpMul    = '*'\n\tOpDiv 
 = '/'\n\tOpLParen = '('\n\tOpRParen = ')'\n)\n\n// Precision settings could be expanded here if rounding were required.\nconst DefaultPrecision = 64<|\"}], "                                
     }                                                                                                                                                                                        
   ]                                                                                                                                                                                          
 }

---

{
  "providers": {
    "local-vllm": {
      "baseUrl": "http://localhost:8000/v1",
      "api": "openai-completions",
      "apiKey": "dummy",
      "compat": {
        "supportsDeveloperRole": false,
        "supportsReasoningEffort": false
      },
      "models": [
        {
          "id": "google/gemma-4-31B-IT",
          "contextWindow": 262144
        }
      ]
    }
  }
}

---

sudo docker run -e HF_TOKEN={replace me}   -e VLLM_LOGGING_LEVEL=DEBUG   -it --gpus all  -v ~/.cache/:/root/.cache/    -p 8000:8000   vllm/vllm-openai:gemma4-cu130   google/gemma-4-31B-IT --enable-auto-tool-choice --tool-call-parser gemma4 --reasoning-parser gemma4
RAW_BUFFERClick to expand / collapse

Your current environment

Technical Environment:

  • Model: google/gemma-4-31B-IT
  • Inference: vLLM (--tool-call-parser gemma4)
  • Orchestrator: Pi Code Agent
  • Machine: Nvidia DGX Spark

🐛 Describe the bug

What happened?

The Gemma 4 (31B) model, running via vLLM + PI coding agent, is failing to generate valid tool calls for the edit function. While the model successfully provides the edits array (containing oldText and newText), it consistently omits the mandatory path property required by the tool schema.

Error Message: Validation failed for tool "edit": - path: must have required property 'path'

Root Cause Analysis: The model is generating syntactically correct code diffs but is failing to adhere to the strict JSON schema constraints of the tool definition. This is likely due to a mismatch between the model's output formatting and the vLLM tool parser, or a lack of emphasis on the path parameter in the system instructions.

Error

Validation failed for tool "edit":                                                                                                                                                           
   - path: must have required property 'path'                                                                                                                                                 
                                                                                                                                                                                              
 Received arguments:                                                                                                                                                                          
 {                                                                                                                                                                                            
   "edits": [                                                                                                                                                                                 
     {                                                                                                                                                                                        
       "newText": "<|\"// Supported operators as constants to ensure consistency across lexer, parser, and evaluator.\nconst (\n\tOpAdd    = '+'\n\tOpSub    = '-'\n\tOpMul    = '*'\n\tOpDiv 
 = '/'\n\tOpLParen = '('\n\tOpRParen = ')'\n)\n\n// SupportedFunctions defines the list of built-in functions available in expressions.\nvar SupportedFunctions =                             
 map[string]bool{\n\t\"sqrt\":  true,\n\t\"abs\":   true,\n\t\"floor\": true,\n\t\"ceil\":  true,\n}\n\n// Precision settings could be expanded here if rounding were required.\nconst        
 DefaultPrecision = 64<|\"|",                                                                                                                                                                 
       "oldText": "<|\"// Supported operators as constants to ensure consistency across lexer, parser, and evaluator.\nconst (\n\tOpAdd    = '+'\n\tOpSub    = '-'\n\tOpMul    = '*'\n\tOpDiv 
 = '/'\n\tOpLParen = '('\n\tOpRParen = ')'\n)\n\n// Precision settings could be expanded here if rounding were required.\nconst DefaultPrecision = 64<|\"}], "                                
     }                                                                                                                                                                                        
   ]                                                                                                                                                                                          
 }

PI config

{
  "providers": {
    "local-vllm": {
      "baseUrl": "http://localhost:8000/v1",
      "api": "openai-completions",
      "apiKey": "dummy",
      "compat": {
        "supportsDeveloperRole": false,
        "supportsReasoningEffort": false
      },
      "models": [
        {
          "id": "google/gemma-4-31B-IT",
          "contextWindow": 262144
        }
      ]
    }
  }
}

vllm

sudo docker run -e HF_TOKEN={replace me}   -e VLLM_LOGGING_LEVEL=DEBUG   -it --gpus all  -v ~/.cache/:/root/.cache/    -p 8000:8000   vllm/vllm-openai:gemma4-cu130   google/gemma-4-31B-IT --enable-auto-tool-choice --tool-call-parser gemma4 --reasoning-parser gemma4

How can I fix this or this is a bug?

Steps to reproduce

Load Gemma4 with vLLM and then connect it with pi coding agent.

extent analysis

TL;DR

The issue can be fixed by modifying the vLLM tool parser to include the mandatory 'path' property in the tool call generation.

Guidance

  • Verify that the Gemma 4 model is correctly configured to generate the 'path' property by checking the model's output formatting and the vLLM tool parser settings.
  • Check the PI config file to ensure that the 'local-vllm' provider is correctly configured to support the 'path' property.
  • Modify the vLLM tool parser to include the 'path' property in the tool call generation, potentially by updating the --tool-call-parser flag in the vLLM command.
  • Test the updated configuration by reloading Gemma4 with vLLM and reconnecting it with the PI coding agent.

Example

No code snippet is provided as the issue is related to the configuration of the vLLM tool parser and the Gemma 4 model.

Notes

The issue may be specific to the Gemma 4 model and the vLLM tool parser, and may not be applicable to other models or configurations. Further debugging and testing may be required to fully resolve the issue.

Recommendation

Apply a workaround by modifying the vLLM tool parser to include the mandatory 'path' property in the tool call generation, as this is the most likely cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING