Repository navigation
ref(agent): Remove model handoff, Turn router, and model profiles - #2681
Merged
Merged
Conversation
Every agent Turn now runs on one model (default anthropic/claude-opus-5.5) at one reasoning level (default high). Set the model with createApp modelId or AI_MODEL, and the reasoning level with AI_REASONING_LEVEL. Remove the handoff tool, the Turn router, model profiles, the router eval suite, and handoff.eval.ts. Stored handoff and turn_routed events stay readable: replay applies legacy handoff replacement history and skips routing rows, and the report API and dashboard skip both. Drop the unused junior_agent_invocations.model_profile column. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Drop migration 0077. The column is nullable text with no default, so new inserts leave it NULL and old pods can still write it during rollout. A follow-up removes the column after #2681 deploys. Co-Authored-By: David Cramer <[email protected]>
Co-Authored-By: David Cramer <[email protected]>
Contributor
|
14 screenshot changes — 14 changed · 0 added · 0 removed Review screenshots in Frameshift Show 8 more changed screenshots |
dcramer
marked this pull request as ready for review
November 4, 2026 20:21
Evals ran on gpt-6-luna through the standard profile. They now run on Opus 5.5, which exposed fixture gaps: - delivery: the 1x1 stub image looks blank, so Opus would not send it. Return a real red panda PNG. - calendar: "next tuesday" on a Monday is ambiguous, and Guardian read it differently. State the date. - forks: the decision reply only said blue was picked, so Opus would not say the banner is blue. Say it was applied.
dcramer
approved these changes
Nov 4, 2026
This was referenced Nov 5, 2026
dcramer
added a commit
that referenced
this pull request
Nov 8, 2026
…soning (#2866) The behavioral and integration eval configs now default `AI_MODEL` to `openai/gpt-6-luna` and `AI_REASONING_LEVEL` to `high`. This cuts eval cost. Since #2681, evals use the product default, Opus 5.5 at `high`. Before #2681, the `standard` profile was Luna at `high`, and most eval Turns ran on it. - Both values use `||=`. `apps/example/.env.example` loads both as empty strings, so `??=` would keep the blanks and fall back to Opus. A non-empty `AI_MODEL` or `AI_REASONING_LEVEL` in the env or a local `.env` file still selects another model. - The Guardian suite already defaults to Luna. The classifiers suite uses the decision model. Neither changes. - The Roach recording key includes the model id, so the first run of each case on Luna misses and records again. ## Fixes from the Luna runs - **Auth MCP fixture:** the `budget-echo` tool said it only confirms the MCP connection, so action review correctly rejected it for a budget lookup. It now looks up a budget and returns one. - **Lost reply:** when Slack rejects a reply, the failed-turn note for the next Turn now says the reply was not delivered. Before, it said only that the person may have seen an error. A local probe confirmed that the lost reply does not reach the next Turn's model context. The `delivery_failed` test in `local-agent-runner.test.ts` asserts the new note. - **History fixture eval:** a failing comparison now prints the first row that differs, because the eval reporter cuts off the deep-equal diff. ## Integration evals keep only runtime rules Integration evals are hard pass/fail, so cases that depend on a model choice moved to the behavioral suite (80% floor). Each moved case keeps its assertions. - To behavioral: no visible reply (`conversation/delivery.eval.ts`), the reply after a lost reply (`conversation/delivery.eval.ts`), the creator credential default for a new schedule (`scheduler/credentials.eval.ts`), one event automation for an issue or a repo (`coding/event-automations.eval.ts`), and the progress report after a child agent's turn budget (`agent/child-agents.eval.ts`). - Integration keeps the runtime part of two split cases: a rejected Slack reply fails the Turn and stores nothing, and a child agent past its turn budget gets a result Turn that succeeds. - The eyes-reaction case now checks the Slack reaction, not a direct `addReaction` call. If Junior did not keep the requested reaction, the completed reaction would follow, so `reactions == ["eyes"]` still proves the rule. A call from a Code Mode script now counts. - The script output-limit case now expects the cut note from #2823 (`[cut: … full: /tmp/jr/…]`). The old `.junior/codemode` note no longer exists on `main`. Not run here: the eval suites themselves, because they need AI Gateway access. `local-agent-runner.test.ts` and the `@sentry/junior` and `@sentry/junior-evals` typechecks pass. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0AHB7N2JCR%3A1794030228.239499 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0AHB7N2JCR%3A1794030228.239499) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0AHB7N2JCR%3A1794030228.239499/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]> Co-authored-by: David Cramer <[email protected]>
This was referenced Nov 9, 2026
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.
Every agent Turn now runs on one model at one reasoning level. The default is
anthropic/claude-opus-5.5athigh. Set the model withcreateApp({ modelId })orAI_MODEL. Set the reasoning level withAI_REASONING_LEVEL.Removed
handofftool andagent/handoff.ts, with handoff compaction (compactContextForHandoff, thehandoffcompaction mode, and theprofile_changeddiscard).services/turn-router.ts), its prompt blocks, and the router attachment previews inprompt.ts.model-profile.ts,createApp({ profiles, defaultProfile }),AI_HANDOFF_MODEL,AI_MODEL_PROFILES, and thespawnAgentprofileinput.evals/router/,evals-router.yml, the router harness and config,evals:router) andevals/integration/coding/handoff.eval.ts.openspec/changes/model-handoff.The fast, Guardian, reranker, vision, and web search models are unchanged.
spawnAgentkeeps itsreasoning_levelinput.Rollout and data
handoffandturn_routedrows stay readable. Replay applies a legacy handoff's replacement history and skips routing rows, so checkpoints still resume. The report API and dashboard skip both types. New writes of either type are rejected.turn_routedrows.junior_agent_invocations.model_profilestays in the schema but code no longer reads or writes it. It is nullable with no default, so new rows leave it NULL and old pods can still write it during the rolling deploy. A follow-up PR drops the column after this ships.Prod cost and latency
No change. Prod has run one
defaultprofile (Opus 5.5,high) with no Turn router since getsentry/junior-prod#589. This PR makes that the only path.junior-prod follow-ups when this ships
server.ts: replace the Normalize egress auth-required for broker-backed OAuth #589 block (defaultProfile: "default"andprofiles.default = { modelId: "anthropic/claude-opus-5.5", reasoningLevel: "high" }) withmodelId: "anthropic/claude-opus-5.5", or drop it to use the default.JuniorAppOptionsno longer hasprofilesordefaultProfile, so typecheck fails until this changes.AI_MODEL,AI_REASONING_LEVEL,AI_HANDOFF_MODEL, andAI_MODEL_PROFILES.AI_MODELnow sets the agent model whencreateAppomitsmodelId. Remove the two handoff and profile variables.app/skills/self-improve/SKILL.mdline 73 tells the agent to usehandoff. Remove that sentence.Known gap
The #2585 memory recall gap still exists.
handoff.eval.tswas its only eval, so this PR removes that coverage. Thomas owns the fix.Checks
pnpm typecheck(junior, dashboard, evals),pnpm lint(includes file length, test architecture, and migration metadata), andpnpm skills:checkpass.@sentry/juniorvitest: 3126 passed; onlyattachment-s3-storage.test.tsfails here because the sandbox has no local S3 endpoint (file untouched). Dashboard e2e and evals run in CI only (no Chrome or gateway key in the sandbox).via @dcramer.
--
View Session [Sentry]