Repository navigation
Land the five community fixes for 1.9.9 (#713 #714 #715 #716 #717) - #719
Merged
Merged
Conversation
EvaluationRunJob checked `run.pending?` and the scenario runner then wrote `running`, as two steps. A job delivered twice, or two workers that both loaded the run as pending, each replayed the whole suite (every replay a billed provider call that may call the agent's tools), or with scenario_evaluation_fan_out on each enqueued a full set of replay jobs. ScenarioEvaluationRunner#call now moves the run from pending to running in one conditional update, as AgentExecutionJob#claim_pending does, and a runner that loses the claim returns without writing to the run. The claim sits in the runner, so ProjectEvaluationJob, which has the same check-then-run shape, is covered as well. It happens before the selection is read, so a selection that raises (an unsupported provider in a re-run's models) now fails the run instead of leaving it pending forever: `run` was still unassigned when the rescue ran.
Catalog.parse rescued only Psych::SyntaxError. YAML.safe_load refuses a
tag naming a class outside the permitted list (Psych::DisallowedClass) and
an alias to an undefined anchor (Psych::BadAlias) with errors that are not
syntax errors, so a document such as `--- !ruby/object:Object {}` escaped
ScenarioCatalogImport as a 500 from the catalog import and preview
endpoints, and as an internal error from the catalogs_import and
catalogs_preview MCP tools.
The rescue is now Psych::Exception, their common parent, as ScenarioParser
and the CLI credentials reader already do, so these documents get the
same "the catalog is not valid YAML" 422 as a syntax error. The permitted
classes and aliases are unchanged.
ScenarioEvaluationRunner#replay_scenario! checked for a stored result, replayed, and only then took the run's lock to store, so the lock guarded the store and not the provider call. Two deliveries of one EvaluationReplayJob both ran the agent (a billed call that may call its tools) and the second answer was dropped. #fail_result! marked any pending, unscored result errored, so a duplicate delivery that failed (an enqueue error, say) turned the other delivery's good replay into its own error. The replay now takes a claim before the agent runs: a token and expiry per scenario/provider/model in the run's fan-out bookkeeping (scores["_fan_out"]["replays"]), taken under the run lock the bookkeeping already uses, so no migration. The result row cannot carry it, since it is created only once there is an answer, and nothing makes a pair's row unique. A delivery that finds a live claim re-enqueues itself for when the claim expires, as a judge job does inside a scoring lease, and then replays only if nothing was stored, which covers a worker that stopped mid-replay. The owner drops its claim with the store, fenced on its token. #fail_result! now writes only for this delivery's pair: no result yet and no live claim held elsewhere, or the result this runner stored. EvaluationReplayJob hands the failure to the same runner so it knows which that is. This is one active replay per pair across duplicate deliveries, not exactly once: a worker that stops after the provider answered and before the store is replayed after its claim expires.
An ungated group's gate row is met without being held to a bar. A report
whose every result sat in ungated groups therefore had only met rows, and
GateCheck#message (what assert_meets_pass_gates and the RSpec matcher
print) said "every pass gate met", as did `evals run --wait` ("Gates:
every gate met"), even when every answer had failed.
The verdict is kept: the docs promise an ungated group never fails the
run, and a catalog set marked `gated: false` is tested to report gates_met
true. Only the wording changes. GateCheck says every group the run covered
is ungated and no answer was held to a bar, and the CLI prints "Gates:
every group reached is ungated (N); nothing was held to a bar." The
evaluations and CLI guides note it, and point at --min-pass-rate for a
run that should still fail CI.
RubyLLMProvider#extract_content_text kept only `type: "text"` blocks, so a message holding an image (image_url, image, input_image), audio or a file reached RubyLLM as its text alone, or as an empty string when it held only the image, and the reply read as if the model had seen it. The test named "array content filters non-text blocks" asserted only that a response came back. Such a message now raises Errors::InvalidRequest (provider_tag "RubyLLM") naming the block types, before any provider call. MEDIA_BLOCK_TYPES lists the shapes the OpenAI Chat, OpenAI Responses and Anthropic transforms write. Other non-text blocks, such as an earlier turn's reasoning, are still left out, so a history carried over from another provider keeps working. The provider guide gains a Text-Only Content section. Sending images through RubyLLM's attachments is left for a follow-up: it differs between ruby_llm 1.x (Content) and 2.x (Message attachments:), needs data: URLs decoded, and has RubyLLM fetch http(s) image URLs from the application server.
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.
What this does
Lands five community fixes together, each as its own merge commit so GitHub marks the original PRs merged and keeps their authorship:
Catalog.parserefuses whatYAML.safe_loadrefuses (Psych::DisallowedClass,Psych::BadAlias) as an invalid document: 422 and MCP tool errors instead of a 500.Errors::InvalidRequeston image, audio or file blocks instead of sending the text alone. Behavior change for gem users; noted in the CHANGELOG.Each branch added its own
## [Unreleased]→### Fixedsection, so the only conflicts were in the CHANGELOG; the resolution keeps every entry under one list, in merge order. No code conflicts: #713 and #715 touch different regions ofScenarioEvaluationRunner.No migrations. #674 (run leases, migration 033) is not in this set; it has a change request open.
Type of change
🤖 Generated with Claude Code
https://claude.ai/code/session_01PCEJHsJpjXpDa9Kuq9i4Yg