record_search: three-view GIF recorder (map | first person | chat with model reasoning); capture reasoning_content in TurnResult; search_mission.gif artifact

This commit is contained in:
opencode
2026-08-09 17:25:08 +03:00
parent daa0371519
commit a9e45fb427
4 changed files with 289 additions and 0 deletions
+12
View File
@@ -314,6 +314,7 @@ class TurnResult:
calls: list[ToolCallResult] = field(default_factory=list)
interacted: bool = False
message: str | None = None
thinking: str = ""
def detect_multimodal(base_url: str, model: str) -> bool:
@@ -502,6 +503,15 @@ class LLMController:
choice = resp.choices[0]
text = choice.message.content or ""
result = TurnResult(text=text)
# Some providers return reasoning tokens separately (e.g. deepseek-r1
# style models); surface them when present.
msg = choice.message
thinking = (
getattr(msg, "reasoning_content", None)
or getattr(msg, "reasoning", None)
or ""
)
result.thinking = thinking if isinstance(thinking, str) else ""
calls = choice.message.tool_calls
if not calls:
self.messages.append({"role": "assistant", "content": text})
@@ -741,6 +751,8 @@ async def run_llm_agent_loop(
turn = await controller.invoke()
if turn.text:
log("agent", turn.text[:400])
if turn.thinking:
log("think", turn.thinking[:400])
summary["tool_calls"] += len(turn.calls)
for c in turn.calls:
if (