Backend: - Enterprise Agent refactored from single-round to ReAct multi-turn loop - New agent.ts (LLM decision node) + tool-executor.ts (tool execution + Gen-UI) - tool-defs.ts extracted for shared tool schemas - MAX_ITERATIONS=6 safeguard against infinite loops Frontend: - MessageBubble: Markdown + code highlighting + LaTeX + tables - ThemeToggle: light/dark/system theme cycling - chart-result Gen-UI card: recharts bar/line/pie/area charts Infrastructure: - Docker Compose (lightweight): only LangGraph + Frontend, Azure cloud for PG/Redis/Blob - Dockerfiles for dev (hot reload) and prod - Makefile with dev/prod/down/logs commands - Updated CLAUDE.md and agent definitions for LangGraph.js architecture Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
68 lines
4.1 KiB
Markdown
68 lines
4.1 KiB
Markdown
# SOC LangGraph.js 本地 Docker 部署复测报告
|
|
|
|
## 测试环境
|
|
- 后端: http://localhost:8080 (容器 soc-langgraph)
|
|
- ��端: http://localhost:3002 (容器 soc-langgraph-ui)
|
|
- 测试时间: 2026-04-10
|
|
- Docker 镜像: soc-langgraph:local
|
|
|
|
## 测试结果汇总
|
|
|
|
| # | 测试项 | 端点 | 结果 | 备注 |
|
|
|---|--------|------|------|------|
|
|
| 1 | 后端健康检查 | GET /info | PASS | 返回 `{"flags":{"assistants":true,"crons":false}}` |
|
|
| 2 | 创建 Thread | POST /threads | PASS | 返回 thread_id, status=idle |
|
|
| 3 | Agent 流式对话 (generalInput) | POST /threads/{id}/runs/stream | PASS | Router -> generalInput, AI 正常回复中文 |
|
|
| 4 | Agent 非流式对话 | POST /threads/{id}/runs/wait | PASS | 返回 2 条消息, AI 回复正确 |
|
|
| 5 | Chat Graph | POST /threads/{id}/runs/wait (chat) | PASS | 独立 chat graph 正常工作 |
|
|
| 6 | Enterprise - KB 搜索 | POST /threads/{id}/runs/wait (agent) | PASS | Router -> enterprise, 调用 kb_search, 检索到 5 条结果, UI 组件 knowledge-result 正常 |
|
|
| 7 | Enterprise - 工单列表 | POST /threads/{id}/runs/wait (agent) | PASS | 调用 ticket_list, 返回 3 条工单, UI 组件 ticket-summary 正常 |
|
|
| 8 | Enterprise - 网络搜索 | POST /threads/{id}/runs/wait (agent) | PASS | 调用 web_search, 找到 5 条结果, UI 组件 search-result 正常 |
|
|
| 9 | Thread 历史记录 | POST /threads/{id}/history | PASS | 返回 4 条历史条目 |
|
|
| 10 | Thread 状态 | GET /threads/{id}/state | PASS | 返回消息列表及��态 |
|
|
| 11 | 助手列表 | POST /assistants/search | PASS | 3 个 graph: agent, chat, email_agent |
|
|
| 12 | 前端 HTML | GET http://localhost:3002/ | PASS | 返回 200, 完整 HTML |
|
|
| 13 | 前端 API 地址 | JS bundle 检查 | PASS | 指向 http://localhost:8080 |
|
|
| 14 | 后端日志 | docker logs | PASS | 最近运行无 error 日志 |
|
|
|
|
## 修复的问题
|
|
|
|
### 问题 1: AZURE_OPENAI_ENDPOINT 格式错误 (已修复)
|
|
- **原值**: `https://ai-gzy0016231ai975636166896.cognitiveservices.azure.com/openai/responses?api-version=2025-04-01-preview/`
|
|
- **修正**: `https://ai-gzy0016231ai975636166896.cognitiveservices.azure.com`
|
|
- **原因**: LangChain AzureChatOpenAI 会自动拼接 `/openai/deployments/{name}/chat/completions` 路径,endpoint 只需基础 URL
|
|
- **文���**: `/Users/gongzhiyong/go/SOC/langgraph/.env` (第 2 行)
|
|
|
|
### 问题 2: 多个 Agent 节点使用 ChatOpenAI 而非 AzureChatOpenAI (已修复)
|
|
- **现象**: Router 节点成功路由后, generalInput/chat 等节点报 `OPENAI_API_KEY environment variable is missing`
|
|
- **原因**: 这些节点使用 `new ChatOpenAI({model: "gpt-4o-mini"})`, 需要普通 OpenAI API Key, 但项目用的是 Azure OpenAI
|
|
- **修复方案**: 创建共用工厂函数 `createLlm()`, 统一使用 AzureChatOpenAI
|
|
- **修改的文件**:
|
|
- `src/agent/utils/create-llm.ts` -- 新建, 共用 LLM 工厂函数
|
|
- `src/agent/supervisor/nodes/router.ts` -- 改用 createLlm()
|
|
- `src/agent/supervisor/nodes/general-input.ts` -- ChatOpenAI -> createLlm()
|
|
- `src/agent/chat-agent/index.ts` -- ChatOpenAI -> createLlm()
|
|
- `src/agent/enterprise/nodes/tools.ts` -- 内联 createLlm -> 共用 createLlm
|
|
- `src/agent/trip-planner/nodes/classify.ts` -- ChatOpenAI -> createLlm()
|
|
- `src/agent/trip-planner/nodes/tools.ts` -- ChatOpenAI -> createLlm()
|
|
- `src/agent/trip-planner/nodes/extraction.ts` -- ChatOpenAI -> createLlm()
|
|
- `src/agent/email-agent/nodes/write-email.ts` -- ChatOpenAI -> createLlm()
|
|
- `src/agent/email-agent/nodes/rewrite-email.ts` -- ChatOpenAI -> createLlm()
|
|
- `src/agent/stockbroker/nodes/tools.ts` -- ChatOpenAI -> createLlm()
|
|
|
|
## 已知的外部依赖状态
|
|
|
|
| 外部服务 | 状态 | 备注 |
|
|
|----------|------|------|
|
|
| Azure OpenAI (gpt-5.4) | 正常 | 所有 LLM 调用成功 |
|
|
| KB Agent (知识库) | 正常 | 检索到 5 条结果 |
|
|
| Gongdan (工单) | 正常 | 返回 3 条工单 |
|
|
| Jina (网络搜索) | 正常 | 搜索到 5 条结果 |
|
|
| Daytona (沙盒) | 未测试 | 需要特定代码执行场景 |
|
|
|
|
## 通过率
|
|
|
|
**14/14 通过 (100%)**
|
|
|
|
所有后端 API 端点和前端页面均正常工作。两个核心 Bug 已修复并验证。
|