Merge pull request #322 from hardness1020/fix/extract-text-placement

fix(s06): move extract_text() next to its only caller
This commit is contained in:
gui-yue
2026-05-29 14:02:22 +08:00
committed by GitHub

View File

@@ -136,12 +136,6 @@ def run_todo_write(todos: list) -> str:
print("\n".join(lines))
return f"Updated {len(CURRENT_TODOS)} tasks"
def extract_text(content) -> str:
"""Extract text from message content blocks."""
if not isinstance(content, list):
return str(content)
return "\n".join(getattr(b, "text", "") for b in content if getattr(b, "type", None) == "text")
TOOLS = [
{"name": "bash", "description": "Run a shell command.",
"input_schema": {"type": "object", "properties": {"command": {"type": "string"}}, "required": ["command"]}},
@@ -186,6 +180,12 @@ SUB_HANDLERS = {
"edit_file": run_edit, "glob": run_glob,
}
def extract_text(content) -> str:
"""Extract text from message content blocks."""
if not isinstance(content, list):
return str(content)
return "\n".join(getattr(b, "text", "") for b in content if getattr(b, "type", None) == "text")
def spawn_subagent(description: str) -> str:
"""Spawn a subagent with fresh messages[], return summary only."""
print(f"\n\033[35m[Subagent spawned]\033[0m")