Skip to content

feat(agent-testing): add Template cases, turn file editor and llmJudge spend - #494

Merged
iceljc merged 9 commits into
SciSharp:mainfrom
yileicn:main
Oct 31, 2026
Merged

iceljc merged 9 commits into
SciSharp:mainfrom
yileicn:main

Conversation

@yileicn

@yileicn yileicn commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Agent-testing UI updates: a new Template case type, a per-turn file editor, llmJudge spend on the run page, and a round of review fixes.

Case editor

  • Template case type: calls one of the entry agent's templates directly, so it needs an entry agent and a template picked from it, and cannot have history. Changing the entry agent (by hand or from an AI draft) clears the template.
  • Assertion types a template call cannot satisfy (routedToAgent, agentChain, toolCalled, toolNotCalled) are hidden from the type picker and rejected on save; the richContent output source is hidden too, since a template call returns text only.
  • Turn files: each turn can add, edit and remove files (name + URL). Files are kept through load and save, so editing a case no longer clears files attached through the API.
  • Entry agent, involved agents, template and the scope page's changed-agents pickers are searchable.
  • The reviewed date is stamped in local time (toISOString() gave yesterday before 08:00 in UTC+8).
  • If the form is edited while the authoring assistant is working, its draft still replaces the form, but a warning now says so and Undo brings the edits back.

Run page

  • Reloads when only the run id changes (SvelteKit reuses the component), ignores stale responses, and keeps the last snapshot when a poll fails.
  • "Re-run failed" queues one run per model set the failures ran on.
  • Stats and pricing are keyed by provider + model, so the same model name under two providers no longer collides.
  • llmJudge spend is shown separately from the model under test: the cost table has "Agent tokens / cost" and "Judge tokens / cost" columns, and each case has a Judge badge.
  • A Judge row at the end of the cost table names the judge model the run was scored with, its total spend and its unit cost. It is read from the run, not the suite, so changing the suite's judge later does not relabel old runs.
  • Progress shows as finished / planned ("10 / 30") on the run page and in the suite's run history, and the cost table fills in while the run goes. Runs without plannedCount show the finished count as before.

Lists

  • Suite and case/run lists show a load error with Retry instead of an empty state.
  • The suite agent filter applies on pick and ignores out-of-date responses.
  • A new success or error notice restarts its timer instead of being hidden early by the previous one.

Backend dependency

Needs the matching BotSharp AgentTesting plugin changes (Template case type, judgeTokens / judgeCost on results, pricing snapshot, judgePricing and plannedCount on runs). Against an older plugin build the Judge column and Judge row stay hidden and unit cost shows as unknown.

Test plan

  • Create a Template case: pick an entry agent and template, add turn files, save and reload
  • Run a suite with an llmJudge assertion; check the Judge column, the Judge row and the per-case badge
  • Re-run failed on a multi-model run
  • Filter suites by agent; switch quickly between agents

🤖 Generated with Claude Code

yileicn and others added 2 commits October 31, 2026 11:10
- Template cases call one of the entry agent's templates directly, so they
  need an entry agent and a template picked from it, and cannot have history
- Turn files have no editor yet; carry them through load and save so editing
  a case in the UI does not clear files attached through the API

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The agent list is long enough that scrolling for one is slow; apply the
  same search box the assertion pickers already have to entry agent,
  involved agents, changed agents and the Template case's template

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

yileicn and others added 5 commits October 31, 2026 11:46
- Turn files were read-only; add an editor so they can be added and removed
  in the UI, and require both a name and a URL on save
- A template call does not route or call functions, so routedToAgent,
  agentChain, toolCalled and toolNotCalled have a fixed result in a Template
  case; hide them in the Type picker and reject ones already on the case
- Clear the template when the entry agent changes, since templates belong to
  one agent; retry loading templates after a failed fetch
- List Template in CASE_TYPES

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad failures

- Run page reloads when the run id changes: Re-run Failures navigates on the same
  route, so the mount-only load kept showing the old run and never polled
- Stop polling a run that never loaded, keep the last snapshot on a failed poll,
  and never overlap polls so an older response cannot overwrite a newer one
- Re-run failures in one run per model set: a run applies its models to every
  case, so a single run forced one case's model onto the others
- Key per-model stats and pricing by provider and model, not model alone
- Suite page shows a retryable error when cases or runs fail to load instead of
  the empty states, which read as data loss
- Clear the template when an AI draft changes the entry agent, and keep
  Template cases off richContent, which a template call never returns
- Stop rejecting .NET-only regex syntax that JS RegExp cannot parse
- Add missing en/zh strings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Judge spend is kept out of the model-under-test totals, so it gets its own
  column per model and its own badge per case, shown only when a judge ran

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Give judge tokens and judge cost their own columns in the latency table
- Separate tokens and cost with a slash in the per-case badges

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… edits

- Stamp the reviewed date in local time; toISOString() gave yesterday before 08:00 in UTC+8
- Restart a notice's timer on a new message so the old one cannot hide it early
- Warn when edits made while the assistant was working get replaced by its draft
- Apply the suite agent filter on pick and ignore out-of-date list responses
- Move the stale form JSDoc back onto the form it describes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yileicn yileicn changed the title feat(agent-testing): add Template case type and keep turn files on save feat(agent-testing): add Template cases, turn file editor and llmJudge spend Oct 31, 2026
yileicn and others added 2 commits October 31, 2026 15:28
…n page

- Add a judge row to the cost table with the run's judge model, total judge spend and unit cost
- Merge tokens and cost into one "Agent tokens / cost" column beside "Judge tokens / cost"
- Translate "Judge model" as "Judge 模型" in Chinese

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- totalCount only counts finished executions, so a running run showed no progress
- Show finished / planned on the run page and the suite's run history; older runs without plannedCount keep the old figure

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iceljc
iceljc merged commit 81eb031 into SciSharp:main Oct 31, 2026
1 of 2 checks passed
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.

2 participants