"""Quick diagnostic script — run interactively to trace what's failing.""" import asyncio import logging logging.basicConfig(level=logging.DEBUG, format="%(asctime)s [%(levelname)s] %(name)s: %(message)s") async def main(): # Step 1: Can the agent call tools at all? print("\n=== Step 1: Agent tool-calling test ===") from orchestrator.agent import agent reply = await agent.run( "test_user", "请在 C:\\Users\\hyuyao\\Documents\\PhoneWork 目录开一个新的 Claude Code 会话,conv_id 随便取。" ) print("Agent reply:", reply) # Step 2: Check manager sessions print("\n=== Step 2: Active sessions ===") from agent.manager import manager print(manager.list_sessions()) # Step 3: If session exists, try sending a message sessions = manager.list_sessions() if sessions: cid = sessions[0]["conv_id"] print(f"\n=== Step 3: Send 'hello' to session {cid} ===") out = await manager.send(cid, "hello") print("Output:", out[:500]) else: print("No sessions — tool was not called or failed.") asyncio.run(main())