diff --git a/src/anthropic/lib/tools/_beta_runner.py b/src/anthropic/lib/tools/_beta_runner.py index df182137..2c9a26e5 100644 --- a/src/anthropic/lib/tools/_beta_runner.py +++ b/src/anthropic/lib/tools/_beta_runner.py @@ -246,6 +246,10 @@ def __run__(self) -> Iterator[RunnerItemT]: message = self._get_last_message() assert message is not None + # Update container from response for programmatic tool calling support + if message.container is not None: + self._params["container"] = message.container.id + self._iteration_count += 1 # If the compaction was performed, skip tool call generation this iteration @@ -497,6 +501,10 @@ async def __run__(self) -> AsyncIterator[RunnerItemT]: message = await self._get_last_message() assert message is not None + # Update container from response for programmatic tool calling support + if message.container is not None: + self._params["container"] = message.container.id + self._iteration_count += 1 # If the compaction was performed, skip tool call generation this iteration