perf(panel): add incremental step transport, memoized aggregation, atomic cache writes, and hidden-view gating

- Project display-only step fields in /api/telemetry, skip unchanged step payloads via stepRevision, coalesce identical client refreshes, and share in-flight backend trajectory scans across same-account requests
- Reuse normalized step values and memoize up to two range aggregations in usage-aggregator gated by step timestamps, pricing revision, model overrides, timezone, and source identity; cache per-trajectory model facts and single-agent step preparation via WeakMap/WeakRef
- Persist trajectory checkpoints atomically in trajectory-cache-file.mjs via chunked writevSync + renameSync while reusing serialized step byte slices for unchanged conversations
- Render step turn-rail lines/dots via CSS pseudo-elements, allocate speed-reason nodes on demand, short-circuit unchanged table reconciliations, and cache per-series LOESS publication fits in SessionStepCharts
- Gate DOM updates and timers across closed overlay panels, hover popups, inactive settings tabs, and unchanged ConsumptionView payloads
- Distinguish canceled steps (CORTEX_STEP_STATUS_CANCELED) and untimed compaction steps from generic incomplete timing in speed-metrics and bilingual i18n labels
This commit is contained in:
fish
2026-11-15 23:33:08 +09:00
parent 03d3160ef0
commit 8968e03adb
33 changed files with 1692 additions and 920 deletions
+7 -7
View File
@@ -14,7 +14,7 @@ import {
normalizeClientOverviewModules,
telemetryStore,
} from '../store/telemetryStore.js';
import { uiStore } from '../store/uiStore.js';
import { getVisibleMonitorView, uiStore } from '../store/uiStore.js';
import { CustomScrollbar } from '../components/ui/CustomScrollbar.js';
export { CTX_CHANNEL_DEFS } from '../components/widgets/ContextWindowWidget.js';
@@ -37,7 +37,7 @@ export const LiveOverviewView = defineComponent({
const widgetHost = createDynamicWidgetHost({
containerEl: overviewInner,
mode: 'overview',
isVisibleFn: () => uiStore.getState().activeView === 'overview',
isVisibleFn: () => getVisibleMonitorView() === 'overview',
initialModuleKeys: DEFAULT_CLIENT_OVERVIEW_MODULES,
});
@@ -58,13 +58,13 @@ export const LiveOverviewView = defineComponent({
}
function ensureCountdownTicker() {
if (uiStore.getState().activeView !== 'overview') {
if (getVisibleMonitorView() !== 'overview') {
stopCountdownTicker();
return;
}
if (!countdownTickTimer) {
countdownTickTimer = setInterval(() => {
if (uiStore.getState().activeView === 'overview' && latestData) {
if (getVisibleMonitorView() === 'overview' && latestData) {
renderData(latestData);
}
}, 30_000);
@@ -88,7 +88,7 @@ export const LiveOverviewView = defineComponent({
(st) => ({ telemetry: st.telemetry, minuteTick: st.minuteTick }),
({ telemetry: data }) => {
latestData = data;
if (uiStore.getState().activeView !== 'overview') {
if (getVisibleMonitorView() !== 'overview') {
const stillRunning =
(Array.isArray(data?.runningConversations) && data.runningConversations.length > 0) ||
Boolean(
@@ -110,7 +110,7 @@ export const LiveOverviewView = defineComponent({
const unsubView = uiStore.subscribe(
(st) => ({
activeView: st.activeView,
activeView: getVisibleMonitorView(st),
ctxInspectorAgentId: st.ctxInspectorAgentId,
}),
(slice) => {
@@ -136,7 +136,7 @@ export const LiveOverviewView = defineComponent({
const unsubI18n = i18nStore.subscribe(
(st) => st.locale,
() => {
if (uiStore.getState().activeView !== 'overview') {
if (getVisibleMonitorView() !== 'overview') {
isDirty = true;
// Refresh initial skeleton labels even before telemetry arrives
if (!latestData) {