Skip to content

fix(evals): Sweep eval tasks by age or run id instead of by prefix - #1522

Open
jirispilka wants to merge 8 commits into
masterfrom
claude/epic-dijkstra-hjc4n0-1424
Open

jirispilka wants to merge 8 commits into
masterfrom
claude/epic-dijkstra-hjc4n0-1424

Conversation

@jirispilka

@jirispilka jirispilka commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Closes #1424. tasks_fixtures.ts deleted every non-fixture eval-* task on every invocation, so a merge-tier run that started while another was in flight destroyed the first run's tasks. CI hid it by serializing the merge tier (eval-merge-master), which also queued back-to-back master pushes. #1423 fixed this for schedules; tasks still swept by prefix.

What changed

Tasks now sweep by age or --run-id, like schedules: without --run-id, only eval-* tasks older than 6 h; with it, only that run's names at any age. The permanent fixture is exempt by name. The eval-merge-master concurrency group is gone.

The eight merge/tasks/* items that create a task name it …-{{uniq}} in Langfuse (edited 2026-10-11), so each run and trial works on its own tasks.

Why one script instead of mirroring #1423

The issue asked to mirror schedules_fixtures.ts. Doing that left two scripts that were the same code apart from the fixture name, with a hidden ordering contract (tasks before schedules on seed, schedules before tasks on teardown) repeated in four workflow steps, the README and a docstring. So they're merged:

  • evals/scripts/fixtures.ts (pnpm run evals:mcp-agent:fixtures) sweeps schedules, then tasks, then resets both fixtures. One order, correct for seed and teardown.
  • evals/scripts/sweep.ts holds the one delete rule for both kinds.
  • CI has one seed step and one always() teardown step.

Trade-off: a failing schedule sweep now skips the task sweep. The next seed deletes anything older than 6 h, so the cost is delayed cleanup, not leaks.

Proof it works

AI disclosure: written with Claude Code (shepherd pipeline, four reviews); the Langfuse edits and the live proof were run by the agent.

🤖 Generated with Claude Code

`tasks_fixtures.ts` deleted every non-fixture `eval-*` task on every run, so a merge-tier run starting while another was in flight destroyed its tasks; CI serialized the whole merge tier to hide it.

Mirror the schedules sweep: a side-effect-free `tasks_sweep.ts` keeps young tasks in seed mode (6 h age), and `--run-id` deletes only that run's names. CI tears tasks down in an `always()` step with the run id, the local hint prints both teardown commands, and the `eval-merge-master` concurrency group goes.

Claude-Session: https://claude.ai/code/session_01TJHJaSzUGq29JbjEwNPqUY
jirispilka added a commit that referenced this pull request Oct 12, 2026
## Why

Closes #1426. `runAgentWithRetry` replays a trial's whole prompt after a
transient agent error, but `{{uniq}}` was resolved once per trial, so
the retry asked for the same schedule name. A create that succeeded
before the failure collided with itself on the replay and failed the
zero-tool-error gate.

## What changed

`{{uniq}}` now resolves to `-<runId>-n<len>-t<trial>r<attempt>`, inside
the retry loop, so each attempt names its own resource and the judge
reads the name the attempt that ran used.

Sibling: #1522 (#1424) adds `tests/unit/evals.tasks_sweep.test.ts` built
with the two-argument `buildRunSuffix`; whichever lands second rebases
that one call site.

## Notes for reviewers (human-written)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01TJHJaSzUGq29JbjEwNPqUY
@jirispilka
jirispilka marked this pull request as ready for review October 12, 2026 14:48
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Oct 12, 2026
@apify-service-account apify-service-account added the t-ai Issues owned by the AI team. label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ai Issues owned by the AI team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(evals): Apply age/run-id sweep to tasks_fixtures.ts

3 participants