Skip to content

fix(typesafeai)!: a stored JevConfig with an unknown key fails to load - #3130

Merged
gold-silver-copper merged 2 commits into
mainfrom
fix/jevconfig-unknown-keys
Nov 8, 2026
Merged

gold-silver-copper merged 2 commits into
mainfrom
fix/jevconfig-unknown-keys

Conversation

@gold-silver-copper

Copy link
Copy Markdown
Collaborator

fix(typesafeai)!: a stored JevConfig with an unknown key fails to load

Description

A stored JevConfig with an unknown top-level key now fails to load, and the error names the key. Before, a typo such as provder for provider was dropped silently. The config then loaded with no routing preferences, so the restrictions it meant to set (for example data_collection = "deny") were not sent.

The fix is #[serde(deny_unknown_fields)] on JevConfig. It has no flatten, aliases or skipped fields, so the attribute applies cleanly. #3127 did the same one level down, for keys inside provider.

What users see change

  • A JSON or TOML JevConfig with an unknown top-level key (e.g. provder) fails to load with unknown field provder, expected one of token, model, endpoint, provider``.
  • Valid configs still load, in JSON and TOML: the redacted token form (token = "[redacted]"), a config with no provider, a config with provider (including max_price and the forms feat(typesafeai): send OpenRouter provider preferences from JevConfig #3118's reload test covers), and a serialized JevConfig read back.
Bug Test
A misspelled top-level JevConfig key loads silently rig-typesafeai tests::a_misspelled_configuration_key_fails_to_load (fails on the test commit with Ok(()), passes on the head)

Changelog

  • (typesafeai) [breaking] A stored JevConfig with an unknown top-level key, such as provider misspelled as provder, fails to load with an error naming the key, instead of loading without the restrictions it meant to set.

Migration

A stored JevConfig with unknown keys now fails to load; remove or fix those keys.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • cargo nextest run -p rig-typesafeai: all 26 tests pass on the head. The new test fails on the test commit.
  • A temporary TOML check (toml added as a dev-dependency for that run only, not committed): the redacted token form, a provider table with max_price, and a TOML round trip all load. A [provder] table fails naming the key. A JSON round trip also loads.
  • cargo xtask verify --affected --base origin/main (on a build server) at the head.

Checklist:

  • I have updated READMEs and Rust docs affected by this change (none affected)
  • I have added tests that prove my fix is effective or that my feature works
  • I did not edit CHANGELOG.md or MIGRATING.md (they are generated at release)

Notes

Line deltas: production +1, tests +19.

Not verified: the committed test covers JSON only, because rig-typesafeai has no TOML dependency. TOML was checked once by hand as above. No live Jev call: this changes only loading, not what is sent.

Follow-ups

@gold-silver-copper
gold-silver-copper added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 9255ba3 Nov 8, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant