Commit Graph

2 Commits

Author SHA1 Message Date
DaiChaoXiong 6257f4f6b8 test(providers): real-endpoint-log regressions for Responses reasoning
Based on the user's actual deepseek-v4-flash debug log (Responses protocol):

- real_log_captures_reasoning_and_tools: replays turn 1 of the real SSE
  (reasoning item + reasoning_text.delta + two function calls) and asserts the
  Done message is [Thinking, ToolCall, ToolCall] with usage mapped
  (input 850 / output 157 / cache-read 768)
- agent_multi_turn_replays_reasoning: drives a 3-turn agent over the real
  protocol (turn 1 + turn 2 from the log, plus a terminating text turn),
  asserting thinking lands in the transcript and the second request's replay
  carries a reasoning item with the captured text and matching call ids

MockTransport gains requests() to inspect all recorded requests.
2026-08-09 22:04:11 +08:00
DaiChaoXiong 8ed56c3952 feat(providers): rewrite Anthropic and OpenAI providers
- Anthropic Messages API (2023-06-01) SSE streaming: text/thinking/tool_use
  blocks, cache usage, stop-reason mapping, errors encoded as events
- OpenAI Responses API + Chat Completions (switchable), tool_calls delta
  accumulation, include_usage, reasoning_content -> thinking
- ProviderConfig with base_url/api_key/context_window/timeout; known-model
  context-window table with three-layer resolution
- background current-thread runtime bridges sync agent loop to async I/O
- mock-transport replay tests (chunks straddle SSE boundaries) + full agent
  integration test
2026-08-09 20:59:49 +08:00