runstone
2d75667b9a
feat(ai): upgrade agent loop tool calling to true SSE streaming
...
Move tool calling from non-streaming (complete) API calls to real
streaming SSE, so text, reasoning, and tool call arguments all arrive
incrementally — users see the AI think and act in real time.
- Extract ~370 lines of non-streaming tool-call functions from
agent_loop.rs (call_with_tools, call_openai_with_tools,
call_claude_with_tools, call_gemini_with_tools) and replace with
a single ai::stream_with_tools() dispatch call.
- Add streaming-with-tools infrastructure to ai.rs (~550 lines):
- StreamToolEvent enum: Chunk, ToolCallStart, ToolCallDelta,
ToolCallComplete — provider-agnostic, feeds into the
StreamingToolCallAccumulator
- stream_claude_with_tools(): parse SSE content_block_start/delta/
stop events, incremental input_json_delta for tool arguments
- stream_openai_with_tools(): parse SSE delta.tool_calls with
incremental function.arguments
- stream_gemini_with_tools(): parse SSE functionCall (Gemini
sends complete objects, not deltas — emit as one chunk)
- Cancellation support via tokio::select! in every streaming loop
- Extended timeout for reasoning models (600s vs 120s)
- StreamingToolCallAccumulator: collect partial tool call fragments
from streaming deltas, then deserialize into complete ToolCall
objects in index order once the stream ends.
2026-06-12 11:43:09 +08:00
..
2026-06-11 11:12:05 +08:00
2026-06-09 10:12:56 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-12 11:43:09 +08:00
2026-06-10 08:37:18 +08:00
2026-05-18 02:35:39 +08:00
2026-06-10 08:37:18 +08:00
2026-05-28 21:25:43 +08:00
2026-05-19 15:56:34 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-05-18 02:35:39 +08:00
2026-06-12 08:48:50 +08:00
2026-05-22 10:42:28 +08:00
2026-06-10 08:37:18 +08:00
2026-06-11 19:35:08 +08:00
2026-06-05 12:41:19 +08:00
2026-05-18 12:27:44 +08:00
2026-05-18 02:35:39 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-09 13:03:11 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-12 01:12:06 +08:00
2026-05-20 16:10:14 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 14:37:53 +08:00
2026-06-07 01:00:34 +08:00
2026-06-10 14:26:50 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 22:12:44 +08:00
2026-06-10 22:12:44 +08:00
2026-06-10 22:12:44 +08:00
2026-06-06 19:03:21 +08:00
2026-05-18 02:35:39 +08:00
2026-06-10 22:12:44 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 14:37:53 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 22:12:44 +08:00
2026-06-03 11:07:04 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 16:39:24 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-05-18 02:35:39 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-02 00:33:58 +08:00
2026-06-10 14:37:53 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-05-18 02:35:39 +08:00
2026-06-11 18:56:38 +08:00
2026-06-10 08:37:18 +08:00
2026-06-04 23:20:15 +08:00
2026-06-12 01:20:11 +08:00
2026-05-21 00:08:47 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 22:12:44 +08:00
2026-06-06 19:03:21 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-05-18 02:35:39 +08:00
2026-06-10 08:37:18 +08:00
2026-06-08 20:09:27 +08:00
2026-05-18 02:35:39 +08:00
2026-06-10 04:34:45 +08:00
2026-06-10 08:37:18 +08:00
2026-05-18 02:35:39 +08:00
2026-06-12 08:48:50 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 18:19:53 +08:00
2026-06-10 10:25:06 +08:00
2026-06-06 09:15:09 +08:00
2026-06-02 11:09:48 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-05-18 02:35:39 +08:00
2026-05-22 14:28:40 +08:00
2026-05-18 02:35:39 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-05-20 18:54:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 11:16:29 +08:00
2026-06-11 11:28:43 +08:00
2026-06-12 00:20:17 +08:00
2026-06-10 08:37:18 +08:00
2026-06-09 10:12:56 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-05-29 00:56:42 +08:00
2026-06-11 10:53:54 +08:00
2026-06-02 10:27:08 +08:00
2026-06-10 08:37:18 +08:00
2026-06-01 12:49:31 +08:00
2026-06-11 11:12:05 +08:00
2026-06-11 12:52:47 +08:00
2026-06-10 08:37:18 +08:00
2026-06-11 22:55:24 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 12:27:26 +08:00
2026-06-10 08:37:18 +08:00
2026-06-05 14:30:25 +08:00
2026-06-11 12:52:47 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-11 22:55:16 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-05-18 02:35:39 +08:00
2026-06-11 10:47:42 +08:00
2026-06-11 11:12:05 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-12 00:20:17 +08:00
2026-05-19 16:08:11 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-03 21:04:19 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00
2026-06-11 12:52:47 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 16:17:59 +08:00
2026-06-11 22:40:10 +08:00
2026-06-11 22:40:10 +08:00
2026-06-10 08:37:18 +08:00
2026-06-11 22:13:27 +08:00
2026-06-10 08:37:18 +08:00
2026-06-12 08:48:50 +08:00
2026-05-18 02:35:39 +08:00
2026-06-10 08:37:18 +08:00
2026-06-11 12:52:47 +08:00
2026-06-10 08:37:18 +08:00
2026-05-18 02:35:39 +08:00
2026-05-18 02:35:39 +08:00
2026-05-23 01:28:52 +08:00
2026-06-10 08:37:18 +08:00
2026-06-10 08:37:18 +08:00