mirror of
https://github.com/zhukunpenglinyutong/jetbrains-cc-gui.git
synced 2026-11-04 23:51:38 +08:00
OpenCode 1.18 run --format json pushes each part only once with terminal state: text/reasoning arrive as complete parts and the tool part arrives as a single completed event. The parser assumed a two-phase started->completed tool flow, so it emitted orphan tool_results that never rendered, and the missing --thinking flag made the CLI suppress reasoning parts entirely. - classify events by part.type (text/reasoning/tool), keeping legacy top-level type matching as fallback - synthesize the tool_use + tool_result pair from the single terminal tool event, keyed on part.callID; started-dedup keeps future two-phase pushes converging on one card - pass the plugin thinking toggle down to --thinking (Java stdin -> channel -> argv); bypassPermissions maps to --auto - emit only the novel suffix when a part is re-pushed with cumulative text, so text never doubles in the UI - capture real 1.18.32 event samples and replay them as test fixtures The streaming toggle stays a documented no-op for OpenCode until a serve-based integration lands (see docs/plans plan for the matrix).
5 lines
1.4 KiB
JSON
5 lines
1.4 KiB
JSON
{"type":"step_start","timestamp":1790662389294,"sessionID":"ses_f1434dcbaffe4h044hajUj1aBt","part":{"id":"prt_0ebcbae22001HbDHiXeooTfxMI","messageID":"msg_0ebcb27e4001t8XiJOxqZwQbFQ","sessionID":"ses_f1434dcbaffe4h044hajUj1aBt","snapshot":"56a4d4a7d4bdefc6e7d8e16ad87a3640c048686f","type":"step-start"}}
|
||
{"type":"reasoning","timestamp":1790662389917,"sessionID":"ses_f1434dcbaffe4h044hajUj1aBt","part":{"id":"prt_0ebcbae29001rIAl8jWrwzGMGA","messageID":"msg_0ebcb27e4001t8XiJOxqZwQbFQ","sessionID":"ses_f1434dcbaffe4h044hajUj1aBt","type":"reasoning","text":"The user asks a simple math question. 17*23 = 17*(20+3) = 340 + 51 = 391.","time":{"start":1790662389290,"end":1790662389906}}}
|
||
{"type":"text","timestamp":1790662390050,"sessionID":"ses_f1434dcbaffe4h044hajUj1aBt","part":{"id":"prt_0ebcbb096001Dev2H1LN26Snz2","messageID":"msg_0ebcb27e4001t8XiJOxqZwQbFQ","sessionID":"ses_f1434dcbaffe4h044hajUj1aBt","type":"text","text":"17 × 23 = 17 × (20 + 3) = 340 + 51 = **391**","time":{"start":1790662389910,"end":1790662390042}}}
|
||
{"type":"step_finish","timestamp":1790662390792,"sessionID":"ses_f1434dcbaffe4h044hajUj1aBt","part":{"id":"prt_0ebcbb402001Q5YODBe9BhORK1","reason":"stop","snapshot":"56a4d4a7d4bdefc6e7d8e16ad87a3640c048686f","messageID":"msg_0ebcb27e4001t8XiJOxqZwQbFQ","sessionID":"ses_f1434dcbaffe4h044hajUj1aBt","type":"step-finish","tokens":{"total":8805,"input":26,"output":35,"reasoning":40,"cache":{"write":0,"read":8704}},"cost":0}}
|