Skip to content

fix: refresh COSY version before signing the catalog request - #36

Merged
simonsmh merged 1 commit into
mainfrom
fix/cosy-refresh-before-catalog
Oct 15, 2026
Merged

simonsmh merged 1 commit into
mainfrom
fix/cosy-refresh-before-catalog

Conversation

@simonsmh

Copy link
Copy Markdown
Owner

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: updateQoderModelsCache now awaits the (daily-throttled, never-throwing) refreshGatewayCosyVersion() before buildAuthHeaders signs the catalog request. The trailing fire-and-forget block and its VITEST skip are gone.

Tests:

  • The fixture stub in catalog-cache.test.ts is now URL-aware, so the releases call stays hermetic without an env-based skip in production code.
  • New regression test: stubs the releases feed with tag 1.1.99 and asserts the releases fetch precedes the catalog fetch and the catalog request is signed with Cosy-Version: 1.1.99.
  • Full suite: lint ✅, 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.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T16:28:26.952997Z 378bb70 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@simonsmh
simonsmh merged commit d51ee0f into main Oct 15, 2026
1 check passed
@simonsmh
simonsmh deleted the fix/cosy-refresh-before-catalog branch October 15, 2026 16:27
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