fix(inference): scope run picker to selected scenario / 修复推理面板运行选择器未按场景过滤的问题#551
fix(inference): scope run picker to selected scenario / 修复推理面板运行选择器未按场景过滤的问题#551cquil11 wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
On the /inference dashboard, the "Run N/M" picker listed every workflow run for the date regardless of the selected scenario (Agentic Traces vs Single Turn): it filtered only by changelog config_keys (model + precision, no benchmark_type). A same-day single_turn sweep therefore leaked into the Agentic Traces picker, and selecting it poisoned the asOfRunId cutoff, blanking the chart. Fix, DB-side and non-circular: the runConfigs coverage in the workflow-info response (which enumerates all runs on a date independently of the asOf cutoff) now carries the raw benchmark_type / isl / osl columns. New pure helpers scenarioRunIdsForDate() (runEnumeration.ts) and restrictRunsToScenario() (utils.ts) derive the run ids with coverage for the selected model + scenario and restrict the picker list to them, with fallbacks so the selector still renders when coverage data is unavailable. GlobalFilterContext exposes runConfigs; InferenceContext filters the picker's runs by the selected scenario before deriving asOf. Filtering from loaded chart rows was rejected as circular (those rows depend on asOfRunId). Unofficial-run overlays are unaffected: dataRunsForDate() dedupes by run id, so the finer-grained DISTINCT rows collapse. 中文:修复 /inference 面板中 "Run N/M" 选择器不区分场景的问题。此前 选择器仅按 changelog 的 config_keys(模型 + 精度)过滤,不含 benchmark_type,导致同一天的 single_turn 运行泄漏进 Agentic Traces 的选择器,选中后会污染 asOfRunId 截断点、使图表变空。修复方案在数据 库侧且无循环依赖:workflow-info 响应中的 runConfigs 覆盖数据(独立于 asOf 截断点、枚举当天全部运行)新增 benchmark_type / isl / osl 原始 列;新增纯函数 scenarioRunIdsForDate()(runEnumeration.ts)和 restrictRunsToScenario()(utils.ts),按所选模型 + 场景推导有数据覆盖 的运行 id 并据此收窄选择器列表,覆盖数据缺失时回退到原列表以保证选择 器正常渲染。GlobalFilterContext 暴露 runConfigs;InferenceContext 在 推导 asOf 之前按所选场景过滤选择器的运行列表。基于已加载图表行的客户 端过滤方案因循环依赖(这些行本身依赖 asOfRunId)被否决。非官方运行 叠加层不受影响:dataRunsForDate() 按运行 id 去重,更细粒度的 DISTINCT 行会被合并。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…date Follow-up to the scenario-scoped run picker: the empty-coverage fallback in restrictRunsToScenario() fired whenever scenarioRunIds was empty, which conflated two cases — "no per-run coverage rows for the date" (old data, where falling back is right) and "coverage exists but zero runs for this scenario" (e.g. 2026-07-02 / 2026-07-04, where only single_turn sweeps ran). In the second case the picker degraded to the old leaky behavior and listed 6 / 3 single_turn runs under Agentic Traces. restrictRunsToScenario() now takes coverageKnown (runConfigs.length > 0): when coverage data is unavailable it still falls back to the changelog-scoped list, but when coverage exists and the scenario has no runs it returns null so the picker hides — matching the (empty) chart instead of offering meaningless "as of run" cutoffs. 中文:场景化运行选择器的后续修复:restrictRunsToScenario() 原先只要 scenarioRunIds 为空就触发回退,混淆了两种情况——"当天没有任何按运行 的覆盖数据行"(旧数据,回退是正确的)与"覆盖数据存在但该场景当天没有 任何运行"(如 2026-07-02 / 2026-07-04,当天只有 single_turn 运行)。 在第二种情况下选择器退化回旧的泄漏行为,在 Agentic Traces 场景下列出 6 / 3 个 single_turn 运行。现在 restrictRunsToScenario() 接收 coverageKnown(runConfigs.length > 0):覆盖数据缺失时仍回退到 changelog 范围列表;覆盖数据存在但该场景无运行时返回 null,选择器随之 隐藏——与(空的)图表保持一致,而不是提供无意义的 "as of run" 截断点。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Filter workflow runs by model, scenario, and precision before global run auto-selection or URL synchronization. Invalid scenario dates and run IDs now resolve synchronously, so July 4 single-turn state cannot leak into Agentic Traces. Remove the downstream fallback-heavy filtering and add focused date and run-coverage regressions. 中文:在全局运行自动选择和 URL 同步之前,按模型、场景和精度过滤 workflow runs。无效的场景日期与运行 ID 现在会同步纠正,避免 7 月 4 日的 single-turn 状态泄漏到 Agentic Traces;同时移除下游复杂回退逻辑并补充定向回归测试。
5bd45d9 to
541bd33
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 541bd33. Configure here.
| effectivePrecisions, | ||
| ); | ||
| return Object.fromEntries(Object.entries(dateRuns).filter(([runId]) => runIds.has(runId))); | ||
| }, [dateRuns, runConfigs, dbModelKeys, effectiveSequence, effectivePrecisions]); |
There was a problem hiding this comment.
Missing empty coverage fallback
Medium Severity
availableRuns always keeps only IDs from scenarioRunIdsForDate, with no fallback when runConfigs is empty. Empty coverage (missing field, fixtures, or old snapshots) yields an empty set, so the picker and workflowInfo disappear even though changelog runs exist. The intended path was to keep the changelog list only when the date has no coverage rows at all.
Reviewed by Cursor Bugbot for commit 541bd33. Configure here.
Version the workflow-info cache key after adding benchmark scenario fields. This prevents Vercel previews from reusing cached pre-change runConfigs rows that lack benchmark_type, isl, and osl and would otherwise hide the valid July 10 Agentic run and changelog. 中文:新增 benchmark 场景字段后升级 workflow-info 缓存键,避免 Vercel preview 复用缺少 benchmark_type、isl、osl 的旧 runConfigs 缓存,从而错误隐藏 7 月 10 日的 Agentic 运行与 changelog。


Summary
Fixes scenario leakage in the inference run/date state.
benchmark_type,isl, andosl.g_runid.single_turncoverage has no Agentic run picker.g_rundate. For DeepSeek V4 Agentic Traces, July 4 resolves to July 10; the only available dates are July 9 and July 10.Verification
中文说明
修复推理面板中运行与日期状态跨场景泄漏的问题。
benchmark_type、isl、osl。g_rundate。DeepSeek V4 的 Agentic Traces 中,7 月 4 日会纠正为 7 月 10 日;有效日期仅为 7 月 9 日和 10 日。验证:app 2,565 项测试、DB 399 项测试全部通过;typecheck、lint、format 均通过,并使用生产数据验证 7 月 4 日无 Agentic 运行。合并前将对最新 preview 完成最终浏览器渲染验证。
Note
Medium Risk
Changes global filter and URL state for run/date selection across scenarios; behavior is covered by unit tests and is limited to inference UI state, not auth or persistence.
Overview
Fixes scenario leakage where single-turn workflow runs could appear under Agentic Traces (and stale dates like July 4 could stick in URLs when switching scenarios).
Workflow coverage now carries
benchmark_type,isl, andoslonRunConfigRow(SQLgetRunConfigsByDate, JSON dump provider, and app types). The workflow-info cache key is bumped toworkflow-info-v2so clients pick up the new shape.Global filters resolve the effective run date with
resolveRunDate(invalid scenario dates snap to the latest available date; user-picked valid dates are kept). Available runs are filtered at the provider viascenarioRunIdsForDateusing model,effectiveSequence, and precisions—so a date with only single-turn data shows no runs for Agentic Traces. Auto-selection and URL sync (g_rundate,g_runid) use the resolved date and effective run ID, not stale raw state.InferenceContext returns an empty run ID when model-filtered runs are missing (global layer already enforces scenario-safe IDs). Tests cover the July 4 leak and stale-date resolution.
Reviewed by Cursor Bugbot for commit 181a514. Bugbot is set up for automated code reviews on this repo. Configure here.