Skip to content

feat(frontend): show each step's trace and metrics in the /m scenario drawer - #8207

Open
mmabrouk wants to merge 115 commits into
feat/m-parity-evaluation-scenariosfrom
feat/m-parity-evaluation-focus-drawer
Open

mmabrouk wants to merge 115 commits into
feat/m-parity-evaluation-scenariosfrom
feat/m-parity-evaluation-focus-drawer

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member

Context

In the old app, the scenario drawer of an evaluation run shows, for the app output and for each evaluator, a button that opens that step's trace, plus the time, tokens and cost of that step. Its header also has full screen, collapse all, copy as JSON and a Form or JSON switch. The /m drawer had none of this. It had only one "Open trace" button, for the app output. So in /m you could not open an evaluator's trace or see what one step cost.

Stacks on #8196 (scenarios table), which also has #8183 (run header) and #8164. The trace drawer message view from #8154 is already in that branch.

Changes

Each section of the drawer (Inputs, Outputs, and each evaluator) now has a title that folds the section. Outputs and each evaluator also get a trace button and badges for time, tokens and cost:

Outputs                          [trace] 370ms  # 39   $0.000005
Exact Match                      [trace] 201μs
Answer correctness (LLM judge)   [trace] 887ms  # 126  $0.000009

The trace button opens that step's trace in the /m trace drawer, with the readable message view. The badge text comes from formatMetricValue, so it reads the same as the scenario table.

The header now has four tools: full screen (wide screens only, because a phone already shows the drawer full screen), collapse or expand all sections, copy the scenario as JSON, and a Form or JSON switch. The JSON looks like this:

{"inputs": {"country": "Japan"}, "outputs": {"outputs": "Tokyo"},
 "evaluators": {"Exact Match": {"success": true}}}

If an evaluator failed, its entry is {"error": "<message>"}. When you move to another scenario, the drawer keeps your view choice. Previous, Next, the scenario picker and copy id work as before.

There are no new requests. The step metrics come from the scenario's metric rows (data[stepKey]), and the page already reads those. The trace ids come from the step results, and the page already reads those traces in one request per page. A new shared helper, stepMetricStats(metrics, stepKey, metricKey) in @agenta/entities/evaluationRun, reads one step's metric. scenarioMetricStats now uses it.

The Annotate tab uses the same body component. It does not pass the new view prop, so its layout and save path stay as they are. All new code is inside the drawer's lazy chunk.

What the tests cover

Risks, most costly first:

  1. A step shows another step's numbers or trace, for example the app's cost under an evaluator. Tests: "Each step shows its own time, tokens and cost", "A step's trace button opens that step's trace in the trace drawer", and "A step without a trace has no trace button".
  2. The drawer sends a request for each step or each scenario. Test: "The traces of a page are read in one request, and moving on reads none".
  3. Copy or JSON gives wrong data, for example a failed evaluator looks like a pass. Tests: "JSON shows the whole scenario as data, and Copy as JSON copies that text" (the test checks the exact text) and "An evaluator that failed shows its error in the JSON view".
  4. The tools stop working: sections do not fold, or the view resets when you move to another scenario. Tests: "Collapse all folds every section, and a section's title opens it again" and "The chosen view stays when moving to the next scenario".
  5. Unit test for stepMetricStats: it reads only the given step, and a missing step or null data returns null.

The tests use the real atoms and hooks. They mock only HTTP, the trace fetch, the clipboard, time and the router. Mutation check: I made four changes to the code, one at a time, and each change made one of the tests above fail:

  • read the metrics from the wrong step
  • open the wrong trace id
  • ignore the folded state
  • drop the evaluator error

One case has no test: two runs of the same evaluator in one scenario. The code shows the first run that has a trace.

Tests / notes

  • Types pass for @agenta/mobile, @agenta/entities and @agenta/oss. eslint and prettier pass on the changed files. The tests of the changed files pass, plus the related run, scenario and Annotate tab tests (73 tests).
  • speed:check passes. Run page 1055.6 KB (limit 1068.9 KB). /evaluations 1071.5 KB (limit 1093.9 KB). App shell 886.8 KB (limit 908.7 KB).
  • I checked the change live against a seeded run. The numbers match the old app for the same test case (370ms, 39, $0.000005 for the app; 887ms, 126, $0.000009 for the LLM judge). I did not check the old app's per-field type tags and per-field Text/JSON switch. They are not ported; the Form/JSON switch for the whole drawer replaces them.

What to QA

  • Open an automatic run, go to Scenarios and open a row. Outputs and each evaluator show a trace button and their own time, tokens and cost.
  • Click an evaluator's trace button. The trace drawer opens on that evaluator's trace, not on the app's trace.
  • Click "Collapse all sections", then click one section title. Only that section opens. Then switch to JSON, click Next, and check that the drawer stays in JSON.
  • Click "Copy as JSON" and paste. The text matches the JSON view.
  • On a phone width, the badges wrap under the section title and the page does not scroll sideways.
  • Regression: the Annotate tab of a human run still shows the plain inputs and output next to the annotation form, and saving an annotation still works.

Agenta Product Agent added 30 commits November 6, 2026 12:16
… drawer

New prompt now opens the local draft in the editable revision drawer, as /w does.
The user can edit and test the prompt, and Create names it and makes the app,
then the new app opens in the /m playground.

Entire-Checkpoint: 01M6R95RE61YVR8YWTMXQ2X0V3
…auto load more in the shared list table

Entire-Checkpoint: 01M6RAQXAZEV9FRVECTEV4CCBE
…loyments-polish

# Conflicts:
#	web/mobile/src/features/variants/DeploymentsTab.tsx
Create new and the folder menu offer Set up workflow in beta developer mode, as /w
does. The form checks the name against existing apps, tests the URL's health route,
creates the app in the open folder and opens it in the /m playground.

Entire-Checkpoint: 01M6RB085GT0MEFMDSG2HCXVB1
…d primary Run all in /m

Entire-Checkpoint: 01M6RBR9B2GNNCD5NETHJ5Q89Z
…evaluations list

The runs list now picks its columns like the old list: one column per
evaluator metric, cost, duration, tokens and errors, reference columns
that follow the tab (Query on Live, Kind on All), and test set and
variant revisions in the cells. Metrics and queries load for rows near
the screen in one batched request.

Shared column plan, cell rule and query revision fetch live in
@agenta/entities/evaluationRun with tests.

Entire-Checkpoint: 01M6RC8BT7P134CEN7ZCZTVXG8
…ons and Observability

In beta developer mode an evaluator id under /apps/<id>/ gets the app menu as
an evaluator (no Registry, Playground opens the evaluator playground), its own
Overview (usage charts, recent revisions, evaluations, no Deployment), and the
switcher lists evaluators next to prompt apps. Evaluator rows link to the
Overview from their menu.
… /m test set editor

- The search and the page actions (Import, Add row, Commit) share one
  row. Add column and the table settings sit in the last column header;
  Delete selected moves into the settings menu, as in /w. TestcaseTable
  and EntityTable get an opt-in settingsDelete prop.
- Commit is outlined while there is nothing to commit.
- Edit details shows Name and Description labels; the rename dialog
  labels its field. NameDialog gets an optional label, so the Settings
  dialogs stay as they are.
- The upload and import previews say Preview (N of M rows);
  readTestsetFilePreview returns totalRows.
… tools, row menu, Use API first, richer deploy dialogs

Entire-Checkpoint: 01M6RBYENTK11MM95AVW30447H
…e, compact boxes in /m

- TestcaseDataEditor gets two opt-in props for the form without a column
  list: fieldOrder ("sorted" by default, or "data" for the row's key
  order) and fieldControls (true by default). The /m test set drawer uses
  the row order and no per-field add or delete, as in /w.
- The /m drawer caps text boxes at their content (the shared editor theme
  sets 150px and loads unlayered in /m) and shows message text in the
  normal font, scoped to the drawer.
- The drill-in field delete button gets the label "Delete field".
- The grid test also checks that a reader gets no Delete selected.
…compare mode in /m

Entire-Checkpoint: 01M6RD686WZ2Z1DQ1EY81609AJ
…olumns' into feat/m-parity-overview-evaluations
… not the count of reads

Entire-Checkpoint: 01M6RD0N8ZZX7V6TMJJ18VPV9H
Back goes to Prompts, dates show the time, the type icon matches the Prompts list, and the list gets row selection with bulk Restore and CSV export.

Entire-Checkpoint: 01M6RD0VMSN7NBV1HVXA9J3XAT
…able drawer in /m

Entire-Checkpoint: 01M6R7QVHFD1SF2TDT0EZ0YW97
Entire-Checkpoint: 01M6R98M2HAX5A68Q2FK9GD5K5
Entire-Checkpoint: 01M6RD3TB3ZZ4KAM7KTT9G6VX0
…n columns and New evaluation in /m beta developer mode

Entire-Checkpoint: 01M6RDPCWDBFF5XFBFW5K2T2YD
… in the playground evaluator picker

Entire-Checkpoint: 01M6RE768M2DYVSN8R0FVWPXD5
…st set editor

As in /w, three entry points open the queue picker for test cases:
- Toolbar "Add annotation queue": the selected saved rows the grid
  shows, or else every saved row it shows.
- Row menu "Add annotation queue" on a saved row.
- Drawer header "Add to queue" for a saved row.

A row that is not saved yet has no id and is never sent. The picker is
the /m AddToQueuePicker, loaded on first open. The row menu keeps its
focus from closing the picker as the menu closes.
…te failures, toast App created

Entire-Checkpoint: 01M6RE11HP08MV5HHABT4WQ8S5
mmabrouk and others added 11 commits November 6, 2026 19:29
feat(frontend): /m run Configuration tab with prompt template, Add evaluator and Edit
…t-columns

feat(frontend): metric, cost and per-tab columns in the /m evaluations list
… drawer

The scenario drawer of the /m run page now shows, for the app output and
for each evaluator, a button that opens that step's trace in the trace
drawer and the time, tokens and cost of the step's own call. The header
gets the old app's tools: full screen, fold all sections, copy the
scenario as JSON, and a Form or JSON view. Sections fold one by one.

The step metrics come from the scenario's metric rows that the page
already reads, and the traces are the ones the page reads in one request
per page, so the drawer sends no new request. The Annotate tab keeps its
plain layout and its save path.

Entire-Checkpoint: 01M6S2RKQEJFM0ZCC4QW91YJK2
…t-filters

feat(frontend): /m evaluations list filter panel like /w
…arios

feat(frontend): filter, column settings and metric columns in the /m scenarios table
feat(frontend): Deployments polish in /m: history tools, row menu, Use API first, richer deploy dialogs
…e-drawer

feat(frontend): create and configure automatic evaluators in the editable drawer in /m
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 1

  • release/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@mmabrouk

mmabrouk commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: @coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@mmabrouk have exceeded the limit for the number of chat messages per hour. Please wait 8 minutes and 11 seconds before sending another message.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Website preview

Preview URL: https://pr-8207-agenta-website-preview.mahmoud-637.workers.dev

Built from f97b3fdbc3eeefef88cf6c6ccf061e4adff8885e. This comment updates in place on every push.

Agenta Product Agent and others added 11 commits November 6, 2026 19:48
feat(frontend): automatic evaluators with types and categories in the /m playground evaluator picker
…-points

feat(frontend): create evaluators from New evaluation, a new queue and trace Annotate in /m
…uator-create

feat(frontend): create a new evaluator from the /m app playground evaluator picker
…tions

feat(frontend): app overview evaluation tables with metrics, Application and New evaluation in /m
…ed-name

fix(frontend): keep the typed name in the new evaluation drawer when an app is picked
fix(frontend): a chat trace opened in the /m playground keeps its messages
fix(frontend): keep playground drafts when leaving or switching revision in /m
Keep the evaluator create flow mounted when the list fills, hand a new
evaluator back once, open older human revisions read-only, load every
revision page before the registry delete guard decides, hide Deploy and
Delete on an archived app overview, classify archived ids with their own
agent flag request, clamp month ranges, stop test set auto-load after a
failed page, and keep row menu clicks from opening the test case drawer.
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Item Value
Status stopped
Commit f97b3fdbc3eeefef88cf6c6ccf061e4adff8885e
Manual expiry (UTC) Not granted
CI deadline (UTC) Not granted
Workflow https://github.com/Agenta-AI/agenta/actions/runs/42281103992

Dependent tests finished. Post /preview for manual review. Environment absence verified; retained storage requires separate provider accounting.

Post /preview as a new comment to request a one-hour preview. Repeating it while active does not extend the hour.
Preview data is disposable. Expiry is enforced by the next successful cleanup sweep, not an exact timer.
Environment deletion stops its compute. Provider-retained storage and permanent services may still be billed.

mmabrouk and others added 2 commits November 6, 2026 20:04
fix(frontend): settle v0.128.10 review threads on /m parity batch 2

This branch has not been deployed

No deployments
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