PhoneWork/debug_test.py
Yuyao Huang (Sam) 0eb29f2dcc feat: 初始化项目基础结构
添加项目基础文件和目录结构,包括:
- 初始化空包目录(bot/agent/orchestrator)
- 配置文件(config.py)和示例(keyring.example.yaml)
- 依赖文件(requirements.txt)
- 主程序入口(main.py)
- 调试脚本(debug_test.py)
- 文档说明(README.md)
- Git忽略文件(.gitignore)
- 核心功能模块(pty_process/manager/handler/feishu等)
2026-03-28 07:44:44 +08:00

32 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""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())