26513d56b794feaf806fc936c63ccadd83039658
bridge_save was wrapping messages and tools_json with json_safe() before storing them as string fields. Since both are already well-formed JSON arrays containing double quotes, json_safe added a second escape layer. agentic_resume then called json_get() which stripped only one layer, leaving the messages array corrupted before it was passed back into agentic_loop. Fix: store messages as messages_raw and tools_json as tools_raw as inline raw JSON values (unquoted), and read them back with json_get_raw. Backward compatibility: fall back to the old string-escaped fields if the raw fields are absent, so sessions saved before this fix can still be resumed. Also fixes write_file returning a pre-escaped literal instead of calling json_safe consistently with every other tool result.
Languages
TypeScript
74.9%
MDX
21.7%
CSS
3%
HTML
0.1%
JavaScript
0.1%