You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Write Tool includes metadata in output and created filecontent #5362
Here are found session exports, to find the offending tool calls using ripgrep rg '\/content>\\n<par', pattern works for vim too.
i created a script to help me parse through my sessions:
uv run https://raw.githubusercontent.com/rwese/opencode_session_analyzer/main/oc_session_analyzer.py --export
Activity
tajbaba999 commentedon Dec 11, 2025
I think the issue happens because params.content sometimes contains metadata blocks. A very small fix is to sanitize the content before writing:
await Bun.write(filepath, typeof params.content === "string" ? params.content : "");can i go ahead with this fix @rwese @rekram1-node
rwese commentedon Dec 11, 2025
I am uncertain, this would be a band-aid, but the cause is that the write-tool is receiving this wrongly. 🤷
But it is pretty annoying, i run into this couple of times a day.
tajbaba999 commentedon Dec 11, 2025
What is the correct/long-term fix instead of the band-aid workaround?
rekram1-node commentedon Dec 12, 2025
can someone share the session they replicate this in?
opencode export > session.json
rwese commentedon Dec 12, 2025
Here are found session exports, to find the offending tool calls using ripgrep
rg '\/content>\\n<par', pattern works for vim too.i created a script to help me parse through my sessions:
uv run https://raw.githubusercontent.com/rwese/opencode_session_analyzer/main/oc_session_analyzer.py --exporthere are the found results.
tool_write_artifacts.tgz
rwese commentedon Dec 14, 2025
one shorter example of the recent
write_tool_output_with_metadata.json