feat: 请求候选追踪添加 proxy 元数据, 修复 usage 状态回退, 优化前端轮询

- 在各 planner decision payload 中注入 proxy trace 信息 (node_id, node_name, url, source)
- request_candidate 报告上下文支持 proxy 字段, extra_data 合并逻辑改为 merge 而非覆盖
- SQL/内存仓库防止 usage status 从 streaming 回退到 pending
- 前端移除活跃请求完成时的全表刷新, active discovery 尊重 globalAutoRefresh 开关
This commit is contained in:
fawney19
2026-04-16 11:57:42 +08:00
parent ffe34120c1
commit d805a28c9a
12 changed files with 418 additions and 26 deletions

View File

@@ -501,6 +501,24 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
.expect("request candidate trace should read");
assert_eq!(stored_candidates.len(), 1);
assert_eq!(stored_candidates[0].status, RequestCandidateStatus::Success);
assert_eq!(
stored_candidates[0]
.extra_data
.as_ref()
.and_then(|value| value.get("proxy"))
.and_then(|value| value.get("node_id"))
.and_then(serde_json::Value::as_str),
Some("proxy-node-openai-cli-local")
);
assert_eq!(
stored_candidates[0]
.extra_data
.as_ref()
.and_then(|value| value.get("proxy"))
.and_then(|value| value.get("source"))
.and_then(serde_json::Value::as_str),
Some("key")
);
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
assert!(