Rust client (and the hindsight CLI) fail on enum values added after their release
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 57/100
Direzione di ricerca
Start with hindsight-clients/rust/build.rs, especially dedupe_inline_enum_titles and the regex replacements, then inspect the generated client enums and how hindsight-cli/Cargo.toml uses the client. Check how unknown enum values and new anyOf tag-group shapes deserialize. Done means responses containing values added after the client release can be parsed without a serde unknown-variant error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
The Rust client (hindsight-clients/rust, generated by progenitor/typify in build.rs) turns every OpenAPI enum into a closed Rust enum with no fallback variant, for example:
pub enum Budget {
#[serde(rename = "low")] Low,
#[serde(rename = "mid")] Mid,
#[serde(rename = "high")] High,
}
Deserializing a value the server added later fails, so the whole response fails to parse. The hindsight CLI is built on this client (hindsight-cli/Cargo.toml), so a published CLI breaks each time the server adds an enum value (e.g. grounding_gone from #6861) in a response the CLI reads. The same applies to a new tag-group shape in an anyOf.
This is the Rust half of #6862. The Python and Go clients are fixed in #6911.
How to see it
- Build the CLI from a commit before an enum value was added.
- Against a current server, read a response that carries the new value (e.g. a mental model whose refresh trace has
mode_fallback_reason: "grounding_gone"). - The CLI fails with a serde "unknown variant" error.
What should happen
An unknown value should be accepted, e.g. a #[serde(other)] Unknown variant (or an Unknown(String) variant that keeps the value), instead of failing the whole response.
Where
hindsight-clients/rust/build.rs: it already rewrites the spec and the generated code (dedupe_inline_enum_titles, regex replacements), so it could add a catch-all variant to each generated enum.
- Lingua principale
- Python
- Stelle
- 45.2k
- Fork
- 5.9k
- Merge medio
- 6h 18m
- PR unite (30g)
- 354
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vectorize-io/hindsight
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vectorize-io/hindsight#6923 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vectorize-io/hindsight#6921 ·
I maintainer di solito rispondono entro 1 giorno
-
core
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
vectorize-io/hindsight#6910 ·
I maintainer di solito rispondono entro 1 giorno
-
core
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vectorize-io/hindsight#6903 ·
I maintainer di solito rispondono entro 1 giorno
-
integration:openclaw
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vectorize-io/hindsight#6893 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vectorize-io/hindsight
Issue simili
-
00 - Bug component: numpy.linalg
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
521xueweihan/HelloGitHub#4543 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
emeryberger/CSrankings#15700 ·
I maintainer di solito rispondono entro 2 giorni
-
Bug | 工作不正常 Triage | 待检查
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
OneDragon-Anything/ZenlessZoneZero-OneDragon#3084 ·
I maintainer di solito rispondono entro 1 giorno
-
Task select patterns with uppercase letters never matchForse già presa @manobhisriram l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno