Repository navigation
test(evals): Add the agent test fixture and move the first slice - #2006
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Sentry Evalsjunior-behavioral
Base commit junior-guardian
Base commit junior-router
Base commit |
Contributor
|
3 screenshot changes — 3 changed · 0 added · 0 removed Review screenshots in Frameshift
|
dcramer
marked this pull request as ready for review
October 1, 2026 23:17
Add the agent test contract rules to the test architecture check. Each rule starts from a baseline list of the files that break it today, and the check fails when a list is not lowered after a fix. Turn on anti-slop/no-module-mocking for integration and component tests with today's files excluded. Track Slack title projection with title generation, and give both to the queue worker's waitUntil. Add error listeners to Postgres pools. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
createApp() now starts from the environment defaults before it applies options, so a later app cannot inherit models, profiles, limits, or Slack settings from an earlier app. Add a limits option for the turn timeout, tool-call limit, slice limit, context window, and consecutive automated-turn limit, and a Slack option for the cross-actor steering mode. Every route and worker now sends to one conversation work queue: Slack ingress, heartbeat, OAuth callbacks, spawn bindings, ACP, events, and web input through the dashboard API. A host can replace the Vercel transport with an in-process queue that receives a consume function. The worker gives title work to the app's waitUntil. Move dashboard route registration into dashboard-routes.ts to keep app.ts under the file length limit. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add the agent test fixture in packages/junior-evals/src/fixture. A test calls run() with an input, continues or forks the returned Conversation, and reads replies, tool calls, reactions, and turn states through Junior's reporting API. Inputs go through the app routes: signed Slack Events API webhooks and the conversations API. The real agent and model run every turn. Loaded history writes earlier turns with the product store functions, and insert functions write setup data the same way. Move the continuity eval and the scheduler credentials eval to the fixture, and add fork evals that run real turns. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fork and Slack steering behavior that needs the agent now runs as integration evals on the agent test fixture. Steering cases send messages from onProgress while the first model request waits, so the real ingress, mailbox, and reply policy decide what happens. The fork API test now builds its source history from stored rows and keeps the API contract checks: idempotent concurrent forks, the frozen history version, privacy, and nested fork notes. The Slack ingress test keeps the duplicate-delivery and late-stop rules, which do not need the agent. Slack replies in call results come from Slack thread posts, so posts that Junior does not store, such as the opt-out acknowledgement, count as replies people saw. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Loaded history now writes the same rows as a real web or Slack turn: the stored input, the turn lifecycle, the agent input, the accepted reply, and handled markers. A fixture test compares the rows with a real turn, without ids, timestamps, model usage, and per-run routing and context. history also accepts a recorded conversation: sanitized event rows exported from a real Conversation. The export drops the event types that forks do not copy and replaces people and workspace identifiers. The loader inserts the rows as they are, as a fork copies rows. A fixture test continues every recording, starting with a launch planning conversation. Add insert functions for scheduled automations, event automations, watches, memories, and credentials. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Send every input through one path: the first web input creates the Conversation and the first Slack mention is the thread root. Move result shaping into results.ts, use toJsonValue for transcripts, and drop insert functions that no test uses. Share the queue callback's kill switch, deadline, and rejection rules with in-process consumption instead of copying them. Give the Slack title projection to the worker's waitUntil through the Slack runtime, so a turn still does not wait for slow titles. Slack and team ids in recordings must contain a digit, so words such as TRACKING stay. Steering evals ask for a plain two-sentence reply, which keeps each turn to one model call instead of several canvas edits. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fixture signed fork requests and later web messages in as the default web person. A mention-only Slack thread is private to the person who started it, so forking it returned 403. Every API request for a Conversation now signs in as its starter, and the fork belongs to that person. Add the private Slack thread fork case. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The delivery eval required reportProgress for a lookup that takes less than a second. Whether to post progress then is the model's choice, so the case now checks the grounded answer in one reply without narration. The event automation credentials eval penalized an offer to replace Alice's automation. Any channel member may delete it today, so the rubric now fails only an actual delete or replace, and the test asserts that no delete call ran. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Anyone may edit or delete a public automation, so an offer to replace Alice's task is allowed. The case now fails only an actual delete or replace in the turn, and asserts that no delete call ran. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Inputs must show real user behavior when a judge scores the outcome. A case that only asserts a deterministic outcome, such as turn routing, may use short manufactured inputs. Record this in the eval policy and README, and point new cases at the agent test fixture. Drop the fork case that overlapped the fork-of-a-fork case and judged a contrived question, and remove inputs and assertions that tested nothing. The eval policy now names the fixture's call results as the assertion surface for fixture tests. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
mcp-oauth-client-auth.test.ts landed on main before the rule and resets modules, so it starts on the runtime-config-mutation list. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
dcramer
force-pushed
the
claude/junior-2001-first-slice-96572c
branch
from
October 1, 2026 23:38
ae80774 to
4b9c942
Compare
Loaded Slack history always stored the Conversation as public. A real mention-only turn learns no channel type, so Junior treats it as private, and a later thread message in a channel makes it public. The loader now applies the same rule to each history turn. Direct messages arrive as message events with an im channel type, as Slack sends them. The loaded history test also compares the stored visibility with a real turn. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2b03a64. Configure here.
A real direct message turn stores explicitMention as true, because Junior routes every direct message like a mention, even without the @junior token. Loaded history now states that rule, and a fixture test compares DM history with a real DM turn. The comparison tests also require the real turn to succeed, so a failed turn reads as such. Refs #2001 Co-Authored-By: Claude Opus 5.5 <[email protected]>
10 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds the agent test fixture from #2001 and moves the first slice of tests onto it: the fork tests, the Slack steering tests, the continuity eval, and the scheduler credentials eval. Every turn under test runs the real agent and model. Earlier turns come from loaded history, not model fakes.
A test drives one Junior app only through its routes and reads results through the reporting API:
Product changes in
@sentry/junior(no change to agent behavior):createApp()resets runtime config on every call, so a later app cannot inherit an earlier app's models, profiles, limits, or Slack settings. It also acceptslimits(turn timeout, tool-call limit, slice limit, context window, consecutive automated turns) andslack.crossActorMidRunMode.getVercelConversationWorkQueue()directly. A host can swap the Vercel transport for an in-process queue withconversationWorkQueue: (consume) => queue. In-process delivery reuses the callback's kill switch, deadline, and rejection rules.waitUntil. A turn still does not wait for slow titles.errorlisteners.Fixture (
packages/junior-evals/src/fixture/):onProgress: watches real AI Gateway and Slack traffic, so a test can send input while a turn runs. It never fakes a response.historyalso accepts sanitized recorded conversations; one is included.Test rules:
scripts/check-test-architecture.mjsadds the five rules from the issue. Today's violations are listed inscripts/test-architecture-baseline.json, and the check fails unless an entry is lowered when its file is fixed.anti-slop/no-module-mockingis on for integration and component tests. Today's files are excluded.Review notes:
createJuniorApi()behind a signed-in test viewer, not the dashboard package. Workspace packages are installed as copies, so loading the dashboard in tests would load a second copy of the Junior runtime.packages/junior/testswithout model fakes. Duplicate deliveries and late stops need exact timestamps the fixture does not send.Later steps from #2001, not in this PR:
heartbeat(),githubWebhook(),event(), andcompleteAuth().webFetch/webSearchreplay in the fixture.packages/junior/testson AI Gateway requests.streamFn, and the test-onlyconversationWorkoption.Refs #2001
🤖 Generated with Claude Code