fix: Web Widget SDK + Auto-Reply AgentBot sender + LLM 真实模型对接
## 核心修复 ### 1. Auto-Reply Sender 修复(所有渠道) - AutoReplyListener.sendAutoReply() 通过 botInboxRepo 查询 inbox 关联的 AgentBot - 使用正确的 SenderType="AgentBot"(非小写 agent_bot)传递真实 AgentBot ID - bootstrap 注入 agentBotInboxRepo/agentBotRepo 依赖 ### 2. 事件数据 BUG 修复(影响所有 Webhook 渠道) - incoming_persister.dispatch(): 补全 sender_type/content 到 event.Data - channel/webhook.go: HandleWebhook 同步分发也补全 sender_type/content - 未补全前 AutoReplyListener 找不到字段直接跳过 ### 3. Web Widget SDK 生产验证修复 - cookie → localStorage token 同步(frontend/index.html) - 路由双注册修复(router.go) - Vite SPA 模式 + /widget 重写(vite.config.ts) - WidgetService 注入 Dispatcher 触发事件分发 ### 4. LLM 真实模型对接 - 配置 deepseek-v4-flash @ http://10.58.144.6:2014/v1 - LLM-mode auto-reply 规则创建并验证通过 - Prompt 文档落地: docs/captain-ai-auto-replay-prompt.md ### 5. 新增基础设施 - Helm chart (deploy/helm/) - Widget SDK 生产测试页面 - QA 报告 Closes: BUG-W2 (auth sync), BUG-W3 (route double-reg), BUG-WEBHOOK-EVENT (missing event data fields)
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>GoChat Widget SDK 生产验证测试</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; margin: 40px; line-height: 1.6; }
|
||||
h1 { color: #1f93ff; }
|
||||
.card { border: 1px solid #ddd; border-radius: 8px; padding: 20px; margin: 20px 0; }
|
||||
code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; }
|
||||
.pass { color: #22c55e; font-weight: bold; }
|
||||
.fail { color: #ef4444; font-weight: bold; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>GoChat Web Widget SDK — 生产验证测试页面</h1>
|
||||
<div class="card">
|
||||
<h2>配置信息</h2>
|
||||
<p>website_token: <code>gochat-smoke-widget-token</code></p>
|
||||
<p>baseUrl: <code>http://127.0.0.1:3036</code></p>
|
||||
<p>SDK URL: <code>http://127.0.0.1:3036/app/javascript/entrypoints/sdk.js</code></p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>测试结果</h2>
|
||||
<p id="status-widget" class="pass">⏳ 加载中...</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>测试说明</h2>
|
||||
<p>此页面加载了 GoChat Widget SDK,右下角应出现聊天气泡图标。</p>
|
||||
<p>点击聊天图标可发起对话。页面加载后自动检测 SDK 状态。</p>
|
||||
</div>
|
||||
|
||||
<!-- Widget SDK Embed -->
|
||||
<script>
|
||||
window.chatwootSettings = {
|
||||
type: 'expanded_bubble',
|
||||
position: 'right',
|
||||
locale: 'zh',
|
||||
darkMode: 'light',
|
||||
launcherTitle: '联系我们',
|
||||
welcomeTitle: '欢迎来到 GoChat',
|
||||
welcomeDescription: '请问有什么可以帮您的?',
|
||||
};
|
||||
</script>
|
||||
<script src="http://127.0.0.1:3036/app/javascript/entrypoints/sdk.js"></script>
|
||||
<script>
|
||||
window.chatwootSDK.run({
|
||||
baseUrl: 'http://127.0.0.1:3036',
|
||||
websiteToken: 'gochat-smoke-widget-token',
|
||||
});
|
||||
console.log('Widget SDK initialized');
|
||||
|
||||
// Detect SDK status
|
||||
setTimeout(function() {
|
||||
var el = document.getElementById('status-widget');
|
||||
if (window.$chatwoot && window.$chatwoot.hasLoaded) {
|
||||
el.textContent = '✅ Widget SDK 已加载并就绪';
|
||||
el.className = 'pass';
|
||||
} else if (window.$chatwoot) {
|
||||
el.textContent = '⏳ Widget SDK 加载中 (iframe loading...)';
|
||||
el.className = 'pass';
|
||||
} else {
|
||||
el.textContent = '❌ Widget SDK 未加载';
|
||||
el.className = 'fail';
|
||||
}
|
||||
}, 3000);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user