Repository navigation
fix(server): model guidance ranks real evaluations and keeps delegated turns - #129
Merged
Merged
Conversation
The card keeps the newest groups, so an unscored group and twenty one-sample groups leave a five-sample group off it. Co-authored-by: Cursor <cursoragent@cursor.com>
Newest one-sample groups filled the card before older groups with more scores. Drop groups with no scored samples, then keep the largest groups, newest first. Co-authored-by: Cursor <cursoragent@cursor.com>
fastMode, serviceTier, contextWindow, and ultracode each open their own group, including fastMode false against an omitted fastMode. Effort values, judges, and turn versus subagent stay separate. Co-authored-by: Cursor <cursoragent@cursor.com>
fastMode, serviceTier, contextWindow, and ultracode were splitting one model into singleton groups. The selection key keeps effort, reasoningEffort, and reasoning_effort. Co-authored-by: Cursor <cursoragent@cursor.com>
A command, monitor, group, or delegated-task wake is scored as if the user asked for that work. Co-authored-by: Cursor <cursoragent@cursor.com>
Command, monitor, group, and delegated-task wakes were judged as user prompts. A request with a notification is recorded as skipped and is not sent to the evaluator. Co-authored-by: Cursor <cursoragent@cursor.com>
Every evaluator failure is stored as one generic sentence, so a timeout cannot be told from a payload or a response body. Co-authored-by: Cursor <cursoragent@cursor.com>
Evaluator failures all stored one sentence, so a timeout looked like every other failure. The record keeps the error tag and a short detail, and leaves out the cause payload. Co-authored-by: Cursor <cursoragent@cursor.com>
Chaining the guidance sort widened confidence to string, and the grouping test passed an undefined subagent flag. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Judging the turn while a child was still running left a score that the child's result then marked stale, and the existing row blocked another pass. Hold the judge until every subagent item has left an active status, then replace that row from the settled evidence. Co-authored-by: Cursor <cursoragent@cursor.com>
|
…cored The first evaluation can read an active child and then drop the write when that child settles. Nothing queues a replacement score. Co-authored-by: Cursor <cursoragent@cursor.com>
A child can settle after the evaluation reads the run and before the write. The write drops that stale packet, and a run with no stored row is never scanned again. Co-authored-by: Cursor <cursoragent@cursor.com>
Rows scored before wakes were skipped stay in the guidance window. The card still treats them as user prompts. Co-authored-by: Cursor <cursoragent@cursor.com>
Evaluations stored before wakes were skipped still match the guidance query. A scored or abstaining row whose request is a notification no longer enters that window. Co-authored-by: Cursor <cursoragent@cursor.com>
A subagent revision lookup constrained event_type with equality, so SQLite could not prove the partial index and scanned the stream index instead. Co-authored-by: Cursor <cursoragent@cursor.com>
Guidance groups effort, but a boolean thinking flag and thinking_level still share a group with fast mode and context window. Co-authored-by: Cursor <cursoragent@cursor.com>
Thinking and thinking_level change output quality, but the guidance key only knew three effort ids. Server and client now share one list. Co-authored-by: Cursor <cursoragent@cursor.com>
The stored cause keeps Claude and Codex command text, including stderr, instead of a short classified reason. Co-authored-by: Cursor <cursoragent@cursor.com>
The startup scan runs, then a dropped subscription ends the loop. A child that settles afterward is never queued. Co-authored-by: Cursor <cursoragent@cursor.com>
A single dropped event subscription ended the refresh until the server restarted. The loop logs the failure and subscribes again from the latest cursor. Co-authored-by: Cursor <cursoragent@cursor.com>
Claude and Codex put command output in the error detail. The saved reason now keeps the error tag and a short cause, not that text. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
AGENTS.md rules out waiting on yieldNow; a Deferred completes when the refresh is queued. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comparing json_extract to a TEXT column applies its affinity, so SQLite used only the index's stream_id column and scanned every thread event. A unary plus on the compared value lets the plan seek stream_id, the run or message id, and sequence, in the refresh query and in readRecords. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dges in model guidance Agent and mode options must keep their own guidance group, and a group shows the selection it ranked. A child that ends cancelled or idle mid-evaluation must still lead to a score. An unavailable judge must be recorded as such. The source-message check must seek the message-revision index. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tries settling children Guidance now drops fastMode, serviceTier, contextWindow and ultracode from a selection instead of keeping only effort options, so options like OpenCode agent and ACP mode still separate groups. The card shows that normalized selection. An evaluation retries when a delegated child settles while it runs, and an unavailable judge is classified as provider unavailable. Both evaluation lookups share one indexed source-message check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server no longer reads this list, so moving it to packages/shared and adding Pi's thinking option is outside this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…work Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Blind model evaluations reach an orchestrating model only as the
modelGuidancecard inorchestrator_capabilities. That card showed the weakest data it had. It also lost the orchestrator turns it exists to inform, and it scored work the user never asked for.An audit of 146 real evaluations found these problems:
What changed
Guidance groups with no scored samples are dropped. The rest are ordered by sample count, then by recency, before the card's limits apply.
Groups ignore options that don't change the answer:
fastMode,serviceTier,contextWindowandultracode. Every other option still separates groups, including effort,thinking, OpenCodeagentand ACPmode. The card shows the normalized selection it ranked, not the first record's full option set.A run whose request is an automated wake is recorded as skipped and is not judged.
A failed evaluation stores its error tag plus one fixed cause:
timed out,provider command failed,invalid output,tool activity,provider unavailableorprovider request failed. It never stores provider output. An unavailable, missing or unsupported judge, such as the router's "The selected evaluator is unavailable", now counts asprovider unavailable. Before, it fell through toprovider request failed.A turn with open delegated work waits. It is scored once its children settle, keyed by the child's event revision, so retries and restarts converge.
Review follow-ups:
readRecordsand the refresh query share one source-message check throughmodel_evaluation_message_revision. The refresh scan dropped from about 2.0 s to 0.3 s on a 2.9 GB database.Scope
Blast Radius
Server-side evaluation and guidance only. A read-only count against today's live database finds 60 stored evaluations whose delegated children changed after scoring. All 60 runs have settled. On first start, 59 are re-scored once by the configured evaluator. The other one still has an open child and waits for it. Existing guidance groups that differed only by an agent or mode option now stay separate.
Verification
ModelEvaluations.test.ts,ModelEvaluationSubagentRefresh.test.tsandmodelEvaluation.test.ts. That includes anEXPLAIN QUERY PLANcheck that the shared source-message lookup seeksmodel_evaluation_message_revisionon stream, message id and sequence.vp run check:changedpasses: format, lint, knip, typecheck for 27 packages, and tests.failedoutcome. That's why this PR doesn't touch that path.🤖 Generated with Claude Code