opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: --format json does not print reasoning_content.

Open hksdpc255 opened this issue 1 week ago • 3 comments

Feature hasn't been suggested before.

  • [x] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

--format json does not print reasoning_content for now:

$ opencode run --log-level DEBUG --format json --model xiaomi/mimo-v2-flash-thinking 'Using browser tool to close the browser.'
{"type":"step_start","timestamp":1767790882247,"sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","part":{"id":"prt_b988c2dc6001bXsFv0OrsMkp8a","sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","messageID":"msg_b988c1a5f001fxnzwEnS8bqiNq","type":"step-start"}}
{"type":"tool_use","timestamp":1767790883443,"sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","part":{"id":"prt_b988c31f9001fsXAlUj7wQVAkN","sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","messageID":"msg_b988c1a5f001fxnzwEnS8bqiNq","type":"tool","callID":"call_d46153bfcf1f4f5c9e90347f","tool":"browser_browser_close","state":{"status":"completed","input":{},"output":"{\n  \"message\": \"Browser closed successfully\"\n}","title":"","metadata":{},"time":{"start":1767790883323,"end":1767790883439},"attachments":[]}}}
{"type":"step_finish","timestamp":1767790883443,"sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","part":{"id":"prt_b988c327100194VEblCc5wCY8h","sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","messageID":"msg_b988c1a5f001fxnzwEnS8bqiNq","type":"step-finish","reason":"tool-calls","cost":0.00121912,"tokens":{"input":16954,"output":85,"reasoning":69,"cache":{"read":5,"write":0}}}}
{"type":"step_start","timestamp":1767790885083,"sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","part":{"id":"prt_b988c38db001sNqLOAk31H8Hyn","sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","messageID":"msg_b988c3275001ZD3deWquk5ki3r","type":"step-start"}}
{"type":"text","timestamp":1767790885769,"sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","part":{"id":"prt_b988c3ab3001x6ZfK5RGGaAyze","sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","messageID":"msg_b988c3275001ZD3deWquk5ki3r","type":"text","text":"The browser has been closed successfully.","time":{"start":1767790885768,"end":1767790885768}}}
{"type":"step_finish","timestamp":1767790885769,"sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","part":{"id":"prt_b988c3b88001dZqZV5k9fXzd6P","sessionID":"ses_46773e5bcffergbbCsAcLxPFQh","messageID":"msg_b988c3275001ZD3deWquk5ki3r","type":"step-finish","reason":"stop","cost":0.00106589,"tokens":{"input":15011,"output":41,"reasoning":31,"cache":{"read":2055,"write":0}}}}

I have already verified the reasoning_content can be displayed correctly in TUI.

hksdpc255 avatar Jan 07 '26 13:01 hksdpc255