Repository navigation
Fix #7983 item 1: sync-models validates the language-server catalog shape - #11197
Conversation
…e boundary (#7983 item 1)
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Closes item 1 of #7983 (parse-boundary shape checks, #3068 contract).
Change
bin/sync-models.mjs: the language-serverGetAvailableModelsresponse was read as(await res.json()).response?.models || {}, so shape drift read as zero models. It now goes throughparseLiveCatalogBody, which requires a plain object body, a plain-objectresponse, and a plain-objectresponse.models. Any other shape throws a namedLiveCatalogShapeErrorthat is rethrown past the per-port probe loop instead of being swallowed. Malformed JSON (a syntax failure) keeps the existing per-port skip.bin/sync-models.test.mjs: probe matrix (null, array, scalar,{}, wrong-typedresponseandresponse.models) plus a well-formed case.Note on the site
The issue text places the site at the models.dev read (
:127). The quoted expression.response?.models || {}is the language-server read at:137in this tree. This PR fixes that expression. The models.dev read at:87(fetchModelsDev, returns the parsed body unchecked) is not changed here; it is left for a follow-up item if the chain needs it.Tests
node --test bin/sync-models.test.mjs— 55 pass, 0 fail.node --check bin/sync-models.mjs— OK.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.