refactor(trace): enforce run-only diagnosis model
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
| 字段 | 类型 | 必填 | 说明 |
|
||||
|---|---|---|---|
|
||||
| `id` | BIGINT | 是 | 自增主键 |
|
||||
| `session_id` | VARCHAR(64) | 是 | 所属会话目录 ID,保留用于粗粒度过滤和兼容 |
|
||||
| `session_id` | VARCHAR(64) | 是 | 所属会话目录 ID,作为粗粒度冗余筛选字段 |
|
||||
| `run_id` | VARCHAR(64) | 否 | 所属 `diagnosis_run.run_id`;新执行应写入 |
|
||||
| `step_index` | INT | 是 | 步骤序号,从 0 开始 |
|
||||
| `agent_name` | VARCHAR(32) | 是 | Agent 名称,例如 planner、executor、verifier、composer |
|
||||
@@ -28,14 +28,14 @@
|
||||
|
||||
| 索引 | 字段 | 用途 |
|
||||
|---|---|---|
|
||||
| `idx_session_step` | `session_id, step_index` | 历史兼容和粗粒度排查 |
|
||||
| `idx_session_step` | `session_id, step_index` | 粗粒度排查 |
|
||||
| `idx_agent_step_run_step` | `run_id, step_index` | 按运行筛选步骤并辅助顺序查询 |
|
||||
| `idx_agent_name` | `agent_name` | 按 Agent 类型筛选 |
|
||||
|
||||
## 关系
|
||||
|
||||
- `agent_step.run_id` 逻辑关联 `diagnosis_run.run_id`。
|
||||
- `agent_step.session_id` 保留为 `chat_session.session_id` 的冗余关联,便于粗粒度过滤和兼容查询。
|
||||
- `agent_step.session_id` 是 `chat_session.session_id` 的冗余关联,只用于粗粒度过滤。
|
||||
- `tool_invocation.step_id` 可关联 `agent_step.id`,但当前允许为空且不强制外键。
|
||||
|
||||
## 注意点
|
||||
|
||||
Reference in New Issue
Block a user