You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(clients): capture inline <think> reasoning in vLLM + Ollama (#113)
Reasoning models emit chain-of-thought either in a structured field or
inline in content (often <think>...</think>). VLLMClient.send() only read
the structured `reasoning` field, so when a model put its thinking inline
it was silently dropped -- no REASONING message downstream, breaking
reasoning replay. OllamaClient had a raw-content fallback but never
extracted <think> tags.
Bring both clients to parity with LlamafileClient using the shared
forge.prompts.think_tags.extract_think_tags helper:
- vLLM: rework _resolve_reasoning to a single (reasoning, content) form
used identically by send() and send_stream() -- structured field ->
<think> extraction -> raw content. Strip <think> from TextResponse in
both paths.
- Ollama: extract <think> tags when the structured `thinking` field is
absent; strip <think> from TextResponse in both paths.
Reasoning capture stays gated on self._think; TextResponse tag-stripping
is unconditional, matching LlamafileClient.
Adds 10 regression tests (6 non-streaming, 4 streaming).
Closes#110.
Claude-Session: https://claude.ai/code/session_01EpuVYCYeb1DhWfynCVyA6a
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments