Skip to content

fix(studio): show target in sidebar label for active/in-progress runs#1225

Merged
christso merged 1 commit intomainfrom
fix/show-target-in-active-runs
May 7, 2026
Merged

fix(studio): show target in sidebar label for active/in-progress runs#1225
christso merged 1 commit intomainfrom
fix/show-target-in-active-runs

Conversation

@christso
Copy link
Copy Markdown
Collaborator

@christso christso commented May 7, 2026

Summary

  • Active runs in the Studio sidebar were showing 07/05 10:56 · 0% (no target), while completed runs correctly showed 07/05 10:12 · wtalms-stg · 100%
  • Root cause: the run label derives target from the first JSONL record, but when a run has just started and 0 results have been written yet, there are no records to read from
  • The target is known at launch time (passed as --target in the Studio's POST /api/eval/run request)

Fix

Three changes in the server (eval-runner.ts + serve.ts):

  1. Generate output dir ahead of time: When Studio launches an eval, it now generates the output directory path using the same default logic as the CLI (buildDefaultRunDir), passes it via --output to the subprocess, and stores it alongside the target on the in-memory StudioRun

  2. Lookup function: Exported getActiveRunTarget(indexJsonlPath) from eval-runner.ts — matches a filesystem run to its in-memory StudioRun by the deterministic output path

  3. Fallback in handleRuns: When JSONL has 0 records, handleRuns in serve.ts calls getActiveRunTarget to retrieve the target from the active runs tracker

The target field also now appears in /api/eval/runs responses.

Before / After

Before: 07/05 10:56 · 0%
After: 07/05 10:56 · wtalms-stg · 0%

Test plan

  • New test in run-label.test.ts: active run (pass_rate=0) with target shows target in label
  • bun test apps/cli — 518 pass, 0 fail
  • bun test apps/studio — 18 pass, 0 fail
  • Build, typecheck, lint, validate all pass (pre-push hook)

🤖 Generated with Claude Code

When a Studio-launched eval run has 0 results written yet, the run list
could not derive the target from the JSONL (no records = no target field).
The label showed "07/05 10:56 · 0%" instead of "07/05 10:56 · wtalms-stg · 0%".

Fix: when the Studio launches a run it now:
- Generates the output directory path ahead of time (same logic as the CLI default)
- Passes it via --output to the CLI subprocess so the path is deterministic
- Stores the target and outputDir on the in-memory StudioRun

handleRuns in serve.ts falls back to getActiveRunTarget(indexJsonlPath) when
the JSONL has 0 records, matching by the known output directory path.
The target also now appears in the /api/eval/runs response.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 15a8143
Status: ✅  Deploy successful!
Preview URL: https://2b500d38.agentv.pages.dev
Branch Preview URL: https://fix-show-target-in-active-ru.agentv.pages.dev

View logs

@christso christso merged commit 4cab322 into main May 7, 2026
4 checks passed
@christso christso deleted the fix/show-target-in-active-runs branch May 7, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant