fix: PJ2026-0104010803 P5 残余 events.at(-1) 读侧推理清理 + code-agent metric status (#1759)
useTraceSubscription.ts:
- mergeTraceResults: lastEventLabel 不 fallback 到 events.at(-1)
- mergeTraceSnapshots: lastEventLabel 不 fallback 到 events.at(-1)
- traceSnapshotSignalKey: 不从 events.at(-1) 推导 signal key
server-code-agent-http.ts:
- recordCodeAgentProjectionMetric: status 只读 projection.status
- source 固定为 workbench_read_model
负向源码扫描确认:
- result?.status ?? trace?.status: 消除
- events.at(-1) lifecycle 推断: 消除
- .catch(() => {}) 静默吞错: 消除
- traceStore.subscribe: 仅作为 outbox 不可用时的兼容降级
Closes #1751
Refs #1742
This commit is contained in:
@@ -3658,10 +3658,10 @@ function recordCodeAgentProjectionMetrics(options = {}, { result = null, trace =
|
||||
projectedLatestEventAt: projection.updatedAt ?? trace?.updatedAt ?? result?.updatedAt ?? null,
|
||||
terminalSourceAt: terminalSourceAtFromResult(result),
|
||||
terminalProjectedAt: projection.projectionStatus === "caught-up" ? projection.updatedAt ?? trace?.updatedAt ?? result?.updatedAt ?? null : null,
|
||||
status: result?.status ?? trace?.status ?? "unknown",
|
||||
status: projection?.status ?? "unknown",
|
||||
reason: projectionReason(projection, refreshError),
|
||||
projectionStatus: projection.projectionStatus ?? "unknown",
|
||||
source: result?.agentRun ? "agentrun_v01" : "workbench_read_model"
|
||||
source: "workbench_read_model"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user