Streaming is a translation state machine over the raw DS4 text. The model * may produce and DSML tool blocks; clients should receive those as * protocol-native reasoning/tool deltas, never as visible assistant text. */
| 4879 | return false; |
| 4880 | } |
| 4881 | /* instructions in the Responses API replaces any system message — for Codex |
| 4882 | * it carries the full agent system prompt. Prepend it so render produces a |
| 4883 | * standard system+chat layout. */ |
| 4884 | if (instructions && instructions[0]) { |
| 4885 | chat_msg msg = {0}; |
| 4886 | msg.role = xstrdup("system"); |
| 4887 | msg.content = instructions; |
| 4888 | instructions = NULL; |
| 4889 | /* Insert at the head so it precedes the conversation. */ |
| 4890 | chat_msgs_push(&msgs, msg); |
| 4891 | if (msgs.len > 1) { |
| 4892 | chat_msg tmp = msgs.v[msgs.len - 1]; |
| 4893 | for (int i = msgs.len - 1; i > 0; i--) msgs.v[i] = msgs.v[i - 1]; |
| 4894 | msgs.v[0] = tmp; |
| 4895 | } |