Repository navigation
Catalog parser silently drops schema-invalid entries; 304 refresh can revert external disk-cache merges #4265
derekcrovo
started this conversation in
Bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Environment
prime-agent 0.10.5 (Rust). External tooling maintains
~/.prime/agent/models/provider-model-catalog.v1.json(the documentedcache location beside
models.json).Symptom
Entries that violate the strict per-entry schema are dropped silently
(
InvalidEntries::SkipInvalid, onetracing::debug!each, noaggregate count, no warning). There is no signal that the served model
list is a subset of the cache. Concrete failure we hit: an external
enrichment wrote 235 OpenRouter entries synthesized without the
required
reasoningfield and with 3-keycostobjects (missingcacheWrite). All 235 were dropped on parse, a configured defaultdeepseek/deepseek-v4.1-flash-1017(live on OpenRouter, key valid)became unresolvable, and fresh sessions fell back to
openrouter/z-ai/glm-5.3-flashwith only a generic "Default model ...is not available" message.
Gaps observed (against current tests)
validate_entrybounds cover 0and >1e6 but nothing pins negative values. OpenRouter serves
"pricing": {"prompt": "-1", "completion": "-1"}for uncostedmodels, so a naive synthesizer emits negatives that get dropped.
not_modified_keeps_snapshot_and_updates_fetched_atasserts theetag persists and models still serve, but never compares the
re-stored payload to the previous payload byte-for-byte. Observed
behavior: the daemon's hourly refresh on 304 re-stores its own
last-good payload verbatim, which reverts external merges written
to the cache after the daemon booted (until the daemon restarts).
tracing::debug!perskipped entry; no aggregate count, no warning, no "N of M survived"
marker anywhere on the served list. When a whole lane of models
vanishes, nothing distinguishes "provider removed them" from "our
entries fail validation".
Suggested tests
pre-refresh payload and
fetchedAtis bumpedsomewhere observable (log or catalog diagnostics)
Suggested improvement
Emit a warn-level summary on every refresh when entries were skipped
(
"catalog refresh dropped N invalid entries", maybe with the firstfew ids), so external writers can detect schema drift instead of
mysteriously losing models.
All reactions