Skip to content

fix(chat): Fix the product gaps behind the flaky integration evals - #2055

Merged
dcramer merged 2 commits into
mainfrom
claude/flaky-integration-tests-0c0aeb
Oct 7, 2026
Merged

dcramer merged 2 commits into
mainfrom
claude/flaky-integration-tests-0c0aeb

Conversation

@dcramer

@dcramer dcramer commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Integration evals failed in 26 of the last 60 workflow runs, and five cases caused almost all of the failures. Four of them showed a product gap. The fifth tested its contract in a slow way. This change fixes each cause, so the evals are a stable base for the rest of #2001.

Flaky case Cause Change
Repo-wide event automation Core stored resourceType: "issue" with the identifier getsentry/junior. Nothing checked that an identifier fits its resource type. A resource type can declare its identifier shape. Core rejects a mismatch.
"What events are available" Event type search needed every query word to match. "GitHub events" returned nothing, so the agent searched again. One matching term is enough. More matching terms rank first.
Event automation with system credentials Guardian compared the automation's credentialMode with the credential fact of the current action, then asked the user to confirm what they had requested. One sentence in the Guardian policy, and a Guardian eval case.
Reminder that names the requester "Use a Slack mention" was only text in a tool description. The agent stored "Remind Test User", which notifies nobody. The create and update tools reject an instruction that names the requester without their mention.
Handoff continuity A normal turn took 50 to 75 seconds, and the idle budget is 60. The eval is one short case with no sandbox work.

Event identifier shapes

events.resourceTypes[].identifier is a new optional field of the plugin event contract: { format, pattern }. GitHub declares it for all five resource types. Watches, event automation tools, and dashboard edits use the same check. Event type search returns the format.

The agent now gets this error and corrects the call:

Identifier "getsentry/junior" does not fit resourceType "issue" in namespace "github". Expected format: "owner/repo#number". If the identifier is correct, use one of these resourceType values: "repository".

A resource type without a declared shape accepts any identifier, as before. Linear has the same ambiguity between issue and team and does not declare a shape yet.

Requester mention

This is a behavior change. An instruction that contains the requester's display name must also contain <@U…>. The check covers only the requester, because that is the one name core can map to a user ID. An update is checked only when it changes the instruction.

Handoff eval

The old eval made the agent do a full code cleanup after the handoff. Most of the time went to sandbox work that the contract does not need, and the explicit-request variant passed before #1938, so it protected nothing.

The new case keeps the same history and the forced profile switch. The request is a term that only memory defines: give a review verdict as a reaction. The eval asserts a completed handoff and then an addReaction.

Result
With the #1938 fix 8 of 8 passed, 32 to 40 seconds
Retained instruction removed from compactContextForHandoff 3 of 8 passed. Four failures showed the original symptom: the agent said the old work was done and gave no verdict.

The summary sometimes carries the request by itself, so the eval does not fail every time without the fix. #1938 recorded the same limit.

Evidence

Each case was sampled in one run after its fix:

Case CI failures before (of about 27 runs) After
Repo-wide event automation 7 8 of 8. Four runs sent issue first, got the error, and corrected to repository.
"What events are available" 3 6 of 6
System credentials 3 30 of 30 isolated Guardian reviews (25 of 30 before), 8 of 8 end to end
Requester mention 5 10 of 10
Handoff continuity 8 8 of 8

Also in this change

conversation-turn-work.test.ts polled 5 seconds for a title that comes from a live model call, and it failed once on main. It now awaits the title work that the worker gives to waitUntil.

Not fixed

  • Two cases failed one time each: the agent added a title to a reschedule that the user did not request, and one judge score in scheduler credentials. They are too rare to verify a fix.
  • watched-message-behavior.test.ts failed one CI run on an error after teardown. It has no teardown and belongs to the passive routing group of One fixture for agent tests: run(), continue(), and loaded history #2001.

Refs #2001

🤖 Generated with Claude Code

Integration evals failed in 26 of the last 60 workflow runs. Five cases
caused almost all failures. Four showed a product gap, and one eval
tested its contract in a slow way.

- Event selectors: a plugin resource type can declare the shape of its
  identifiers. Core rejects a watch or event automation whose identifier
  does not fit its resource type, and the error names the type that
  fits. GitHub declares the shape of all five resource types.
- Event type search: one matching term is enough, and resource types
  that match more terms come first. A query such as "GitHub events"
  returned nothing before.
- Guardian: an automation's credential mode applies to its later runs.
  The policy no longer compares it with the credential fact of the
  current action.
- Automation instructions: the create and update tools reject an
  instruction that names the requester by display name without their
  Slack mention.
- The handoff continuity eval asks for a memory-defined review verdict
  as a reaction, with no sandbox work. The turn takes 32 to 40 seconds
  instead of 50 to 75.

The public web Message test awaits the title work that the worker gives
to `waitUntil`. It polled for 5 seconds before.

Refs #2001

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Oct 7, 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 7, 2026 3:23pm UTC

Request Review

@dcramer
dcramer marked this pull request as ready for review October 7, 2026 15:04
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 7, 2026
@sentry-evals

sentry-evals Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-guardian

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 40 0 8 $0.01 0 213.46s

Base commit 5bfac06 has no eval run to compare against.

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Complete 63 0 0 $0.54 0 1,076.33s

Base commit 5bfac06 has no eval run to compare against.

…ier error

The Guardian rule now uses the policy's own term for the credential
fact of the current action, and it states the conclusion: a difference
from an automation's credential mode is not a gap to confirm.

The identifier error names the resourceType parameter and gives the
values that fit the identifier.

Refs #2001

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

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

Review screenshots in Frameshift

Conversation Event Details · Desktop
Conversation Event Details · Desktop
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Conversation Share Details · Mobile
Conversation Share Details · Mobile
Changed
Conversation Share Menu · Mobile
Conversation Share Menu · Mobile
Changed

@dcramer
dcramer merged commit 99ac7e3 into main Oct 7, 2026
46 of 47 checks passed
@dcramer
dcramer deleted the claude/flaky-integration-tests-0c0aeb branch October 7, 2026 15:53
BYK added a commit that referenced this pull request Nov 7, 2026
…tions (#2850)

Fixes #2849.

A child agent that handles a watch event reports it by provider handle
("BYK requested changes on #2055"). The parent then mentioned the
reviewer in Slack and also named them in the third person. The #2248
"you" rule only reached the child, and the child's reply goes to the
parent, not to the person.

The identity now travels up as a Slack mention in the text. There's no
new storage, and it works at any depth:

- **Event task input** (`peopleTags`): `If your reply is to <@U…>, write
to them as "you". Otherwise call them <@U…>, not "BYK".` This replaces
`If you mention <@U…>, write to them as "you", and do not also call them
"BYK".`
- **Child agent runs**: the reply goes to the parent agent, so the child
calls each person by the Slack mention its input gives, not by a handle
or a name.
- **Agent input rules** (root and middle children): a child agent calls
people by mention. When your reply is to a person that a child agent
names, write to them as "you", and don't also name them in the third
person.

A grandchild writes the mention, the middle child keeps it (its reply is
to its parent), and the root writes to the person as "you".

## Tests

- I updated the `peopleTags` text in the task-input unit snapshots and
in `event-wake-delay`.
- New eval in `evals/coding/subscriptions.eval.ts`: the requester
reviews the PR, and the review reaches the thread through a child agent
result. **I did not run it locally.** The sandbox has Node 22 and no
`ROACH_TOKEN`, and Roach needs Node 24.14+. The existing #2248 eval
("address them once as you") also covers the reworded event rule.

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

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A53d78c3a2094119fd5c9c136 -->

--

[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A53d78c3a2094119fd5c9c136/?project=4510944073809921)

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

---------

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

This branch was successfully deployed

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

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant