Description
When local models write large files, they generate content before filePath (matching the schema declaration order). If they exhaust their token budget on content, they never
reach filePath, resulting in SchemaError(Missing key at ["filePath"]). Swapping the field order so filePath is declared first fixes this.
Related: #18108
Plugins
None
OpenCode version
Latest dev
Steps to reproduce
- Configure a local model (e.g. via Ollama/LiteLLM) with limited output tokens
- Ask it to write a large file
- The model generates
content first, runs out of tokens, never produces filePath
- Results in
SchemaError(Missing key at ["filePath"])
Screenshot and/or share link
N/A
Operating System
macOS
Terminal
Terminal.app
Description
When local models write large files, they generate
contentbeforefilePath(matching the schema declaration order). If they exhaust their token budget oncontent, they neverreach
filePath, resulting inSchemaError(Missing key at ["filePath"]). Swapping the field order sofilePathis declared first fixes this.Related: #18108
Plugins
None
OpenCode version
Latest dev
Steps to reproduce
contentfirst, runs out of tokens, never producesfilePathSchemaError(Missing key at ["filePath"])Screenshot and/or share link
N/A
Operating System
macOS
Terminal
Terminal.app