Skip to content

feat(evals): Record and replay evals with the Roach service - #2156

Merged
dcramer merged 5 commits into
mainfrom
feat/evals-remote-roach
Oct 16, 2026
Merged

dcramer merged 5 commits into
mainfrom
feat/evals-remote-roach

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Evals now use the shared Roach service at https://roach-proxy.getsentry.net (getsentry/roach), in place of a local proxy with recordings in git. This is a hard cutover. The service keeps the recordings of the tenant getsentry/junior in its GCS bucket, which deletes each one 30 days after it was written.

What changes

  • src/recording-run.ts starts a run with startRemoteRun(). Workers get the run's controlUrl and token, and open one session per test as before.
  • ROACH_TOKEN selects the mode. With the token, the default is auto. Without it, the service allows only replay. VITEST_EVALS_REPLAY_MODE still overrides. Only global setup reads the token, and it removes it from process.env, so workers and child processes do not get it.
  • src/roach/ is now a copy of the client side of getsentry/roach at 653c28e: client.ts, types.ts, report.ts, and the patterns of values.ts. The local proxy, its CLI, and its tests are deleted. @sentry/roach is not on npm, and pnpm refuses it as a git dependency (ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED, because of its prepare script). src/roach/README.md tells how to update the copy.
  • scripts/network-jail.sh resolves roach-proxy.getsentry.net and allows it on TCP 443. The launcher for a local proxy outside the jail is gone.
  • The committed recordings in packages/junior-evals/recordings/ are deleted. So are evals-prune-recordings.yml and the collect-eval-recordings, commit-eval-recordings, and eval-recordings-mode actions. The four eval workflows pass ROACH_TOKEN to the run step and no longer have a "commit recordings" job.
  • AGENTS.md and "Recordings" in packages/junior-evals/README.md describe the new flow.

Verification

  • pnpm --filter @sentry/junior-evals typecheck passes.
  • On Node 24, I ran startRecordingRun() with the real rules of this branch against the deployed service, without a token. The service accepted the run. A webFetch-style GET and an AI Gateway POST came back 412 missed. The report line and the non-zero exit code worked. Before that, the service refused Junior's local-time value pattern; fix(deploy): Allow the local-time pattern that Junior sends roach#10 fixed it.
  • The jail rules were checked with a stub sudo. They allow 136.69.81.163:443, and the reject rules still come last.
  • I did not run the eval harness tests (pnpm --filter @sentry/junior-evals test) because the sandbox has no Postgres. The only harness test of Roach was the local proxy test, which this PR deletes.

Before merge

  • Give getsentry/junior access to the ROACH_TOKEN organization secret ("Deploy", step 6, in the roach README). Without it, CI runs only replay, and every eval misses.
  • The bucket starts empty, so the first auto run of each suite calls the model live for every request.

Behavior changes to know

  • A local run without ROACH_TOKEN uses replay. The service also refuses requests that no rule records, such as Vercel Sandbox API calls (HTTP 403). So behavioral and integration evals need the token to run locally.
  • Recordings are readable by anyone who can make the same request. The service redacts credential-like request headers, but Junior's own SECRET_ENV list for body redaction is gone, because the service has no per-run secrets.
  • Misses report only the key of the recording, not the closest recording and the differing parts.
  • .gitattributes and warden.toml still name packages/junior-evals/recordings/**. That keeps this large deletion out of review. They can be deleted in a follow-up.

via Junior system actor event.

--

View Junior Session [Sentry]

Evals now start a run on the shared Roach service at
roach-proxy.getsentry.net, in place of a local proxy with recordings in
git. The service keeps the recordings in its GCS bucket.

- Copy the client of getsentry/roach into src/roach/, and delete the
  local proxy, its CLI, and its tests.
- ROACH_TOKEN selects the mode: auto with the token, replay without it.
  Only global setup reads the token.
- The network jail allows the Roach service on HTTPS.
- Delete the committed recordings and the CI that committed, chose the
  mode for, and pruned them. Eval workflows pass ROACH_TOKEN instead.
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 16, 2026 1:04am UTC

Request Review

@sentry-evals

sentry-evals Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-behavioral

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 68 6 0 $0.82 0 471.27s

Base commit 08191a6 has no eval run to compare against.

junior-guardian

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 51 0 7 $0.01 0 50.48s

Base commit 08191a6 has no eval run to compare against.

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 99 1 0 $0.80 0 274.68s

Base commit 08191a6 has no eval run to compare against.

junior-router

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 12 0 0 $0.00 0 2.98s

Base commit 08191a6 has no eval run to compare against.

MSW blocked the session calls that each eval test makes to
roach-proxy.getsentry.net, so every integration eval failed before it
ran. The local proxy was on 127.0.0.1, which MSW already let through.
The local proxy redacted the values of AI_GATEWAY_API_KEY,
SENTRY_EVALS_API_KEY, VERCEL_OIDC_TOKEN, and VERCEL_TOKEN in every
recording. The service only knew credential headers, so a response that
showed one of these values was written to the public bucket. The run
config now sends them as secrets (getsentry/roach#11). A service without
that change ignores the field.

Co-Authored-By: David Cramer <david@sentry.io>
A new origin or value pattern now needs only a change to
recording-rules.ts. getsentry/roach#12 removes the copies in
roach.tfvars.

Co-Authored-By: David Cramer <david@sentry.io>
Co-Authored-By: David Cramer <david@sentry.io>
@dcramer
dcramer merged commit 238f7ee into main Oct 16, 2026
63 of 66 checks passed
@dcramer
dcramer deleted the feat/evals-remote-roach branch October 16, 2026 03:05

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 9a80074a Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant