* docs: design query result run tabs
* feat(query): add result run model helpers
* feat(query): persist result run metadata
* feat(query): record switchable result runs
* feat(query): sync active result run state
* feat(query): cache result run payloads
* feat(query): render result run tabs
* docs: design query result archives
* feat(query): add result archive codec
* feat(query): restore result archives
* feat(query): add result archive actions
* fix(query): toggle execution summary view
* fix(query): avoid archive compression backpressure
* feat(query): remove result runs
* chore: remove local spec docs from pr
AiAssistant.vue:
- Tool call steps now support click-to-expand/collapse for SQL args
and results (expandedSteps set); chevron rotates on open
- Remove fixed-open result display (was always visible, no toggle)
- Max result height raised to 48 (max-h-48) with scroll
ai.ts (buildModePromptLines agent branch):
- Replace vague "prioritize SQL" hint with explicit tool-use
instruction: must call execute_query, not just emit SQL text
- List available tools (list_tables, get_columns, execute_query,
get_sample_data) so LLM knows what it can call
- Clarify allowed statement types for execute_query
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.