Files
aigc-home/docs
Benjiyaya a8fc4e451c fix(agent): attachments no longer crash linked-session turns; ask_user closes its tool batch
Two agent-loop bugs found in the Sep 24 loop evaluation, folded into the
1.5.7 line:

1. A linked-session turn whose user message carried an image/video/document
   attachment crashed 100% of the time: derive_llm_history projects multimodal
   content as an OpenAI parts list, and orchestrate() read that list as the
   goal and called .strip() on it (AttributeError: 'list' object has no
   attribute 'strip'). New log.text_of_content() extracts the text part; the
   goal read uses it, so single-loop and swarm paths both survive attachments.

2. When ask_user paused the turn mid tool-batch, the remaining calls of that
   step never executed but also never received tool results, leaving an
   assistant tool_calls message with dangling ids - an invalid request
   sequence that strict OpenAI-compatible servers 400 on the next turn. The
   pause path now synthesizes skipped tool/call + tool/result events and
   tool-role messages for the un-executed ids before ending the turn.

The new multimodal-goal tests now stub the planner LLM: the attachment
appendix puts newlines in the extracted goal, so the message is never
trivial-path and the unstubbed planner made a real network call - the source
of the tests' flakiness (and the swarm-path test now attaches the document
it always claimed to).

Backend suite: 538 passed.
2026-09-24 03:28:19 +08:00
..