simbiot-harness/venv/lib/python3.12/site-packages/strands/tools/_tool_helpers.py
Simbiot Harness b60439152b Simbiot Harness v0.1: тактовая лестница на Strands + CQRS/ES-спина
- harness/es.py: append-only event store + проекции (образец — кооп-портал)
- harness/levels.py: уровни 1с/1м/1ч/1д, контекст ∝ масштабу
- harness/scheduler.py: уровневые потоки, идемпотентные тики, absorbed-стабы
- harness/isolated_runner.py + _llm_worker.py: LLM-тик в сабпроцессе
  (глобальный asyncio-рантайм Strands не переживает 2+ create_harness)
- cli.py: init/task/tasks/status/events + requeue (написан самим минутным агентом)
- 9router: отдельный ключ sk-simbiot, модель auto (glm-5.3 первым)
2026-09-29 15:28:50 +00:00

30 lines
1.1 KiB
Python

"""Helpers for tools."""
from ..tools.decorator import tool
from ..types.content import ContentBlock
# https://github.com/strands-agents/harness-sdk/issues/998
@tool(name="noop", description="This is a fake tool that MUST be completely ignored.")
def noop_tool() -> str:
"""No-op tool to satisfy tool spec requirement when tool messages are present.
Some model providers (e.g., Bedrock) will return an error response if tool uses and tool results are present in
messages without any tool specs configured. Consequently, if the summarization agent has no registered tools,
summarization will fail. As a workaround, we register the no-op tool.
"""
return "You MUST NOT use this tool. Respond DIRECTLY to the user."
def generate_missing_tool_result_content(tool_use_ids: list[str]) -> list[ContentBlock]:
"""Generate ToolResult content blocks for orphaned ToolUse message."""
return [
{
"toolResult": {
"toolUseId": tool_use_id,
"status": "error",
"content": [{"text": "Tool was interrupted."}],
}
}
for tool_use_id in tool_use_ids
]