修正SuperAgent任务结果来源消息定位

This commit is contained in:
andy
2026-07-12 14:53:54 +08:00
parent bf796946f9
commit eee37315a0
18 changed files with 789 additions and 86 deletions

View File

@@ -18,8 +18,8 @@
| 字段 | 默认值 | 中文说明 |
| --- | --- | --- |
| `hotel_id` | 后端解析 | SuperAgent 默认不传;单酒店阶段由 TH Hotel 后端从 `platform_hotel` 唯一 `ACTIVE` 酒店解析,兼容旧调用传入时必须与系统酒店一致。 |
| `source_provider` | `AGENTBUS` | 来源提供方 |
| `source_channel` | `EMAIL` | 来源渠道 |
| `source_provider` | 通常不传 | 查询类工具可作为隔离条件;写入工具不要求 SuperAgent 传数据库 provider。 |
| `source_channel` | 通常不传 | 查询类工具可作为隔离条件;写入工具不要求 SuperAgent 传数据库 channelAgentBus 邮件真实入库渠道可能是 `OUTLOOK` |
通用返回建议:
@@ -336,6 +336,7 @@ POST /api/ai-query/v1/message-conversation/messages
- SuperAgent 已完成当前邮件的最终任务拆分。
- 已确认外部 `source_message_id` 来自 AgentBus payload`hotel_id` 由 TH Hotel 后端解析。
- 不需要为写入工具传数据库层 `source_provider` / `source_channel`;后端会按系统酒店和外部消息 ID 匹配真实 Inbox 记录。
- 需要把 AI 任务结果交给 TH Hotel 后端进入人工确认流程。
### 7.3 不应使用
@@ -359,11 +360,11 @@ POST /api/ai-query/v1/message-conversation/messages
},
"source_provider": {
"type": ["string", "null"],
"description": "来源提供方,默认 AGENTBUS"
"description": "兼容字段;写入工具通常不需要传,后端写入定位不使用该字段"
},
"source_channel": {
"type": ["string", "null"],
"description": "来源渠道,默认 EMAIL"
"description": "兼容字段写入工具通常不需要传后端写入定位不使用该字段AgentBus 实际入库渠道可能是 OUTLOOK"
},
"source_message_id": {
"type": "string",
@@ -392,6 +393,8 @@ POST /api/ai-query/v1/message-conversation/messages
- `ai_task_results[]` 内部字段较多,完整结构以 `superagent-api-contract.md` 第 8 节为准。
- MCP endpoint 不应重排 `ai_task_results[]`
- `source_message_id` 必须是 AgentBus payload 的 `source.external_message_id`,不是内部 `platform_source_message_inbox.id`;写入工具不要求 SuperAgent 知道 Inbox 的真实 channel。
- 同一系统酒店下如果外部 `source_message_id` 匹配多条 Inbox业务 Service 返回 `SOURCE_MESSAGE_AMBIGUOUS`MCP tool result 应原样保留该错误码和 message。
- 如后续需要强 schema 校验,可在 MCP endpoint 内复制 REST 契约中的细粒度字段约束。
### 7.5 输出