Repository navigation
feat(rig-typesafeai): send OpenRouter provider preferences from JevConfig - #2872
Closed
tmihalicka wants to merge 1 commit into
Closed
tmihalicka wants to merge 1 commit into
tmihalicka wants to merge 1 commit into
Conversation
…nfig JevConfig::provider sets OpenRouter's routing preferences, such as zero data retention, sent beside the model in the /systemone body when set. It reuses rig-core's OpenRouter ProviderPreferences, which now derives Deserialize so a reloaded JevConfig keeps the setting. Fixes 0xPlaygrounds#2871
tmihalicka
force-pushed
the
feat/typesafeai-provider-preferences
branch
from
October 20, 2026 18:13
a753d93 to
0a062e8
Compare
6 tasks done
8 of 11 tasks
Collaborator
|
Closed by #3118 |
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.
Description
Lets
rig-typesafeai'sJevConfigsend OpenRouter'sproviderrouting preferences (zdr,data_collection,only, …) with a Jev evaluation.Fixes #2871
JevConfig::provider(ProviderPreferences): an optional setting, serialized besidemodelin the/systemonebody only when set. TypeSafe's own API never sees it unless a caller sets it.ProviderPreferencesrather than adding a parallel type.ProviderPreferencesand the types inside it now deriveDeserialize.JevConfigis serializable configuration that can be reloaded. Without this,JevConfigcould only skip the field when deserializing, so a reloaded config would silently drop its zero-retention requirement.Changelog
JevConfig::providersends OpenRouter's routing preferences, such as zero data retention, with a Jev evaluation through OpenRouter's/systemone.ProviderPreferencesand the types inside it implementDeserialize, so configuration holding them reloads intact.Migration
None.
Type of change
Testing
cargo fmt --all -- --checkcargo nextest run --locked --profile local -p rig-core openrouter::extension: 26 passedcargo nextest run --locked --profile local -p rig-typesafeai: 24 passedcargo clippy --locked -p rig-core -p rig-typesafeai --all-targets -- -D warnings, and-p rig-cassette --all-features --test openrouteropenrouter/jev/evaluation_sends_provider_preferencesandopenrouter/jev/evaluation_with_an_unservable_route_is_refused, against live OpenRouter withtypesafe/jev-1.13. Diffs reviewed by hand;cargo xtask cassette scan --base origin/main: 0 hits.cargo test --locked -p rig-cassette --all-features --test openrouter -- jev::: 3 passed, including the existingevaluation_reads_the_reported_costcargo xtask check-test-layoutcargo xtask verify --affected --base origin/main: not run to completion.protocisn't installed on my machine, andlance-encoding(fromrig-lancedb) needs it to build, so I've left the full affected run to CI.Checklist:
CHANGELOG.mdorMIGRATING.md(they are generated at release)Notes
sends_provider_preferences_only_when_setchecks the encoded body with and without the setting.provider_preferences_survive_reloading_the_configurationchecks the serde round trip, where only the credential has to be supplied again.provider_preferences_read_back_as_writtenchecks that everyProviderPreferencesfield, including both forms of the untagged enums, reads back as written.evaluation_sends_provider_preferencessends zero-retention preferences; the replay matches the recorded body, so it fails ifproviderstops being sent.evaluation_with_an_unservable_route_is_refusedshows OpenRouter applies the object:only: ["openai"]is refused with a 404 because TypeSafe is Jev's only provider.with_openrouter_jev_cassette_resulttakes aconfigureclosure for theJevConfig, and the existing scenario passes it through unchanged.provider_request_idstaysNonethrough OpenRouter, as noted in the issue.