Roo-Code/src/core
Roo Code 09e8f31f9b fix: coerce write_to_file content to string when model sends object
Some models (e.g., GLM 4.7 via OpenAI Compatible API) incorrectly pass
the content parameter as a JSON object instead of a string when calling
the write_to_file tool. This causes processing to break silently.

This fix adds defensive type coercion in NativeToolCallParser to:
1. Detect when content is not a string
2. Convert it to a formatted JSON string using JSON.stringify
3. Log a clear warning message so users understand what happened

This follows the existing pattern for type coercion (e.g.,
coerceOptionalBoolean for booleans).

Fixes #11040
2026-01-28 08:50:15 +00:00
..
assistant-message fix: coerce write_to_file content to string when model sends object 2026-01-28 08:50:15 +00:00
auto-approval Add some functionality to @roo-code/core for the cli (#10584) 2026-01-09 13:05:15 -08:00
checkpoints Add some functionality to @roo-code/core for the cli (#10584) 2026-01-09 13:05:15 -08:00
condense feat(condense v2.1): add smart code folding (#10942) 2026-01-27 18:47:24 -05:00
config fix: auto-migrate v1 condensing prompt and handle invalid providers on import (#10931) 2026-01-23 22:32:04 -05:00
context/context-management Move @roo-code/cloud to the Roo-Code repo (#7503) 2025-08-28 11:18:45 -07:00
context-management feat(condense v2.1): add smart code folding (#10942) 2026-01-27 18:47:24 -05:00
context-tracking feat(condense v2.1): add smart code folding (#10942) 2026-01-27 18:47:24 -05:00
diff refactor: remove legacy XML tool calling code (getToolDescription) (#10929) 2026-01-23 19:13:55 -05:00
environment feat: lossless terminal output with on-demand retrieval (#10944) 2026-01-27 22:12:19 -07:00
ignore Follow symlinks in rooignore checks (#7405) 2025-08-26 10:12:20 -04:00
mentions Intelligent Context Condensation v2 (#10873) 2026-01-23 12:33:35 -07:00
message-manager feat: lossless terminal output with on-demand retrieval (#10944) 2026-01-27 22:12:19 -07:00
message-queue Move message queue to the extension host (#7604) 2025-09-02 19:12:18 -07:00
prompts feat: lossless terminal output with on-demand retrieval (#10944) 2026-01-27 22:12:19 -07:00
protect Mark code-workspace files as protected (#7403) 2025-08-26 00:09:14 -04:00
task feat: lossless terminal output with on-demand retrieval (#10944) 2026-01-27 22:12:19 -07:00
task-persistence chore: clean up XML legacy code and native-only comments (#10900) 2026-01-22 15:56:11 -05:00
tools feat: lossless terminal output with on-demand retrieval (#10944) 2026-01-27 22:12:19 -07:00
webview feat: lossless terminal output with on-demand retrieval (#10944) 2026-01-27 22:12:19 -07:00