# A paused run continued in the background no longer repeats its tool call

> Agno agents and teams now resume a human-in-the-loop run with background=True and stream=True, the AgentOS default, without the "tool_calls must be followed by tool messages" error from OpenAI Chat Completions.

- Published: 2026-10-01
- Author: Kaustubh Shukla
- Categories: Changelog
- Canonical: https://www.agno.com/blog/a-paused-run-continued-in-the-background-no-longer-repeats-its-tool-call
- Markdown: https://www.agno.com/blog/a-paused-run-continued-in-the-background-no-longer-repeats-its-tool-call.md

When an Agno agent or team resumes a human-in-the-loop run with `background=True` and `stream=True`, the model now sees the paused tool call once. A background continue marks the run `RUNNING` before it rebuilds the messages, and history only skipped runs marked `PAUSED`, `CANCELLED`, `ERROR` or `REGENERATED`. So the paused turn also came back as history, with its tool call but no result, and OpenAI Chat Completions refused the request:

```text
An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'.
```

The AgentOS UI sends both flags on every continue, so any agent or team with `add_history_to_context=True` hit this on confirmation, user input and external execution.

![Real output of the messages Agno builds when a background continue resumes a confirmed tool call. Before: Hi, the assistant's greeting, then "Delete old.log" and the assistant's tool call call_1 appear twice, the first copy with no tool result, followed by the tool message "Deleted old.log". Now: Hi, the greeting, "Delete old.log", the tool call call_1 once, and the tool message "Deleted old.log".](https://www.agno.com/images/v3-1-0-hitl-continue-history.png)

Agno now finds the continued run by its id, whatever status it has stored, and leaves it out of history before applying `num_history_runs` and `num_history_messages`, so earlier turns still reach the model. Thanks to rodrigocoliveira, who found the root cause.

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/05_human_in_the_loop/basic.py), and learn more about [human-in-the-loop](https://docs.agno.com/hitl/overview) and [background execution](https://docs.agno.com/background-execution/overview) in the documentation.
