Repository navigation
fix: refresh COSY version before signing the catalog request - #36
Merged
Merged
Conversation
The fire-and-forget refresh ran only after the model-list request had already been signed, so a catalog fetched right after a new Qoder CLI release was signed with the stale identity, returned the reduced list, and poisoned the model cache for its full TTL (Codex P1 on #35). Await the throttled refresh at the top of updateQoderModelsCache, before buildAuthHeaders signs the request, and drop the VITEST skip: the fixture stub in catalog-cache tests is now URL-aware so the releases call stays hermetic. Adds a regression test asserting the releases fetch precedes the catalog fetch and the catalog request is signed with the freshly fetched version.
Codex Review SummaryThis 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. |
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.
Addresses the P1 Codex flagged on #35 (review comment on
src/catalog.ts).Problem: the COSY refresh was fire-and-forget after the model-list request. When Qoder shipped a CLI release newer than the bundled/cached identity, the catalog request was still signed with the stale version, the gateway returned the reduced catalog, and that list was cached for its full 1h TTL and registered for the whole session. The fresh identity only helped later sessions.
Fix:
updateQoderModelsCachenow awaits the (daily-throttled, never-throwing)refreshGatewayCosyVersion()beforebuildAuthHeaderssigns the catalog request. The trailing fire-and-forget block and itsVITESTskip are gone.Tests:
catalog-cache.test.tsis now URL-aware, so the releases call stays hermetic without an env-based skip in production code.1.1.99and asserts the releases fetch precedes the catalog fetch and the catalog request is signed withCosy-Version: 1.1.99.tsc✅, 311/311 tests ✅, build ✅.Note: v0.6.0 already shipped with the old ordering; this should go out as v0.6.1 once merged.