Skip to content

test(evals): Move the Slack handler and turn failure tests to the agent test fixture - #2089

Merged
dcramer merged 4 commits into
mainfrom
claude/junior-issue-2001-92b2f4
Oct 9, 2026
Merged

dcramer merged 4 commits into
mainfrom
claude/junior-issue-2001-92b2f4

Conversation

@dcramer

@dcramer dcramer commented Oct 9, 2026

Copy link
Copy Markdown
Member

Moves four more groups of tests off the model fakes: skill invocation, a rejected Slack reply, a provider failure, and a message that arrives while a turn is paused. The baseline of files in packages/junior/tests that run the agent goes from 45 to 42, and bot-handlers.test.ts goes from 21 cases to 2.

New in the fixture

  • onProgress reports paused: a turn stopped before it finished, for example at its deadline, and Junior queued the rest of it. The rest waits until the handler finishes, so a test can send a message before the turn continues. The fixture sees this at the queue, which it already replaces. It reports paused only while the reporting API still shows the turn as started.

    onProgress: async (progress, { send }) => {
      if (progress.type === "paused") await send(slackMention("Also end your reply with the line: Owner: Dana"));
    }
  • rejectNextModelRequest() makes the AI Gateway reject one agent request with a provider error. It never writes a model answer. It uses a usage-policy rejection, which Junior does not retry, so the eval has no retry backoff.

  • rejectNextSlackReply() makes Slack reject the next thread reply of Junior.

Where each behavior is tested now

  • A provider failure: one case in lifecycle.eval.ts. The turn fails, Junior posts the safe content-policy reply and clears the status, and the next message gets a normal answer that still knows the first message. The message for each kind of provider error keeps its unit tests.
  • A message during a paused turn: the deadline case in lifecycle.eval.ts sends a mention in the gap, and the one reply of the continued turn uses it. I extended the existing case because a second one adds about 50 seconds to each run.
  • A rejected Slack reply: one case in delivery.eval.ts. The turn fails, the person sees a failure notice, and the next turn does not know the lost reply.
  • A user-only skill that the person does not invoke: one case in evals/skills/routing.eval.ts.
  • Rules that need no agent are component tests: turn-preparation.test.ts (a redelivered message that already has a reply, and the thread backfill rules) and providers/slack/input.test.ts (a redelivered message is saved one time, each author stays the instruction actor of their message, and nothing is saved while a resume holds the lock).

Review notes

  • A failure notice has a random event_id. recording-rules.ts now treats it as a changing value, so it does not break replay.
  • Two cases stay in bot-handlers.test.ts: a redelivery of the paused turn's own message, and a failed queue send for the continuation. No route input can cause them, and nothing else tests those paths.
  • The issue contract in One fixture for agent tests: run(), continue(), and loaded history #2001 has the paused event and the decision for provider failures.

Refs #2001

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 9, 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 9, 2026 3:28am UTC

Request Review

@sentry-evals

sentry-evals Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-behavioral

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 64 5 1 $0.46 0 265.71s

Base commit 1135e97 has no eval run to compare against.

junior-guardian

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 46 0 5 $0.01 0 0.78s

Base commit 1135e97 has no eval run to compare against.

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 87 0 0 $0.49 0 220.69s

Base commit 1135e97 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 0.16s

Base commit 1135e97 has no eval run to compare against.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

8 screenshot changes — 8 changed · 0 added · 0 removed

Review screenshots in Frameshift

Conversation Event Details · Desktop
Conversation Event Details · Desktop
Changed
Conversation Event Log · Desktop
Conversation Event Log · Desktop
Changed
Conversation Image Reply · Desktop
Conversation Image Reply · Desktop
Changed
Conversation Outbox Author · Desktop
Conversation Outbox Author · Desktop
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Conversation Share Details · Mobile
Conversation Share Details · Mobile
Changed
Show 2 more changed screenshots
Conversation Share Menu · Mobile
Conversation Share Menu · Mobile
Changed
Location Detail · Mobile
Location Detail · Mobile
Changed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4b4e636. Configure here.

dcramer and others added 4 commits October 8, 2026 20:26
…nt test fixture

Move the tests of skill invocation, Slack reply rejection, provider
failure, and input for a paused turn off the model fakes. The baseline of
tests that run the agent in packages/junior/tests goes from 45 to 42 files.

The fixture gets three additions. onProgress reports `paused` when a turn
stopped before it finished and Junior queued the rest, so a test can send
input before the turn continues. rejectNextModelRequest() makes the AI
Gateway reject one agent request with a provider error.
rejectNextSlackReply() makes Slack reject the next thread reply.

Rules that need no agent move to component tests of
createPrepareTurnState() and saveSteeringMessages().

Refs #2001

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/37876057923.
The evals of this commit replay them in strict mode.

Eval-Suite: behavioral
A progress handler posts input during a delivery of the worker. The app
can send a queue message for that input, as it does for a stop. The
fixture took that message for one that the worker sent, so it reported
`paused` while the turn was still running.

The queue now posts test input outside the delivery.

Refs #2001

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/37878149578.
The evals of this commit replay them in strict mode.

Eval-Suite: behavioral
@dcramer
dcramer force-pushed the claude/junior-issue-2001-92b2f4 branch from 7f7d34f to 4851031 Compare October 9, 2026 03:27
@dcramer
dcramer merged commit faceee1 into main Oct 9, 2026
52 of 55 checks passed
@dcramer
dcramer deleted the claude/junior-issue-2001-92b2f4 branch October 9, 2026 04:09
sergical added a commit that referenced this pull request Oct 9, 2026
Frameshift reports the same unrelated screenshots on most pull requests.
Across the last 44 reports (#2023–#2089), 202 of 310 changed screenshots
were exact repeats of a diff seen on another PR. Each one flips between
two fixed renders from one capture to the next. 31 of the 44 reports
contained nothing else.

I reproduced CI locally with system Google Chrome (CI uses `channel:
"chrome"`) and Ubuntu's subpixel font settings. With that setup, `main`
produces the same image files CI flips between, byte for byte. I then
tested each change on its own:

- **Partial raster:** Chromium re-rasters only the invalidated part of a
tile, so some pixels depend on paint history. This causes the 1–2 px
diffs at the avatar stack overlap and the repo icon, plus some text
edges. `--disable-partial-raster` removes them. On the conversation
specs, unstable screenshots went from 5 of 18 to 0 of 14.
- **Noise texture:** the full-screen `feTurbulence` overlay still varies
by up to 3/255 with partial raster disabled. Screenshots now hide it
through Playwright's `style` option, using a `data-dashboard-noise`
attribute on the overlay.
- **Late font requests:** `document.fonts.ready` only waits for font
faces the page has already requested. A face requested later can arrive
after the wait and change text. The screenshot helper now loads every
declared face before capture. With this step removed, 4 runs had 7
unstable screenshots: the same Share Details, Share Menu, Detail Focused
and Workspace tab diffs that recur in CI.
- **`SegmentedNav`:** the tab row's scroll position and edge fade
depended on earlier layouts (Locations and Workspaces on mobile). It now
recomputes from the start whenever the row or a link changes size.
- **`ChartSvg`:** the axis label scale came from `getScreenCTM()`, which
was only re-read when the SVG resized. It is now derived from the
element's current size and the viewBox. CI showed labels drawn far too
large or small. I could not reproduce that locally, so this fix is not
proven yet.

Loading fonts from Google at test time was not a problem by itself.
Fonts load live in these runs and the output still matches CI.

Results with all changes: 0 of 84 screenshots varied across 8 full-suite
runs. Without them, `main` had 9 of 84 varying across 3 runs.

When this merges, every saved screenshot changes once because the noise
overlay is no longer captured. Later reports should only show real
changes. If the chart label flip shows up again, the `ChartSvg` change
did not cover it.

Follow-up worth considering: CI uses whatever Chrome the runner image
ships, so a runner image update will shift text in all screenshots at
once. Pinning the browser would avoid that.

<!-- junior-request-attribution:start -->
via @sergical.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0B2KJG9B5Z%3A1791509162.264559 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B2KJG9B5Z%3A1791509162.264559)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B2KJG9B5Z%3A1791509162.264559/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Sergiy Deceive-skiy <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 48510312 Deployed Oct 9, 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