Skip to content

[AI] Improve model catalog metadata and comparison - #33353

Closed
allan-leinwand wants to merge 4 commits into
cloudflare:productionfrom
allan-leinwand:fix/ai-model-catalog
Closed

[AI] Improve model catalog metadata and comparison#33353
allan-leinwand wants to merge 4 commits into
cloudflare:productionfrom
allan-leinwand:fix/ai-model-catalog

Conversation

@allan-leinwand

@allan-leinwand allan-leinwand commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve catalog tags and pricing during model imports.
  • Add aligned model facts and accessible three-model comparison.
  • Format token and non-token pricing with explicit billing units.
  • Improve catalog filtering, sorting, and importer concurrency.
  • Add pagination, ordering, failure, and pricing tests.

Related roadmap epic: RM-27401

Validation

  • pnpm run check
  • pnpm run lint
  • pnpm run format:core:check
  • pnpm run format:content:check
  • pnpm run test -- --run (165 tests)
  • pnpm run build (8,983 pages)
  • git diff --check

Documentation checklist

  • Changelog: not applicable; this updates the existing model catalog UI and metadata.
  • The change adheres to the documentation style guide.
  • Related tracking exists in RM-27401.
  • Redirects: not applicable.

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Review

✅ No outstanding issues in commit 0906ecc.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

No code review issues found.

Conventions

No convention issues found.

Style Guide Review

No style-guide issues found.


Acknowledged by author (8)
Review File Issue Note
Code bin/catalog-import-utils.ts line 28 Progress callback inside try/catch The author says the helper intentionally propagates callback exceptions after draining active workers; moving the callback would restore immediate rejection while leaving active work undrained.
Code bin/catalog-import-utils.ts line 30 Swallowed concurrent errors The author says the helper preserves Promise.all first-error behavior; aggregating errors would change its contract, and detail fetches already convert individual request failures into result values.
Code src/util/models/model-format.ts line 43 Inconsistent display capitalization The author says the labels use sentence case — Input starts a label while input follows Cached — so capitalizing the word mid-label would be incorrect.
Code src/content.config.ts line 420 Missing null handling for external data The author says the catalog API type defines pricing as an object or omitted, and current catalog data contains no pricing: null, so accepting speculative null values would weaken collection validation without a concrete source value.
Conventions PR Reject immediately when the callback throws The author says the helper intentionally propagates callback exceptions after draining active workers, since immediate rejection would leave active work undrained.
Conventions PR Aggregate errors from catalog detail fetches The author says the helper intentionally preserves Promise.all first-error behavior, and aggregating errors would change its contract since individual request failures already convert to result values.
Conventions PR Capitalize comparison label words consistently The author says the labels use sentence case, so 'input' correctly stays lowercase after 'Cached' and capitalizing it mid-label would be wrong.
Conventions PR Handle null pricing in catalog metadata The author says the catalog API type defines pricing as object-or-omitted and no current catalog data contains pricing: null, so accepting speculative null values would weaken collection validation.
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

@allan-leinwand

Copy link
Copy Markdown
Collaborator Author

Automated review triage:

  • CR-b99b2b589c1b will not change: ModelView.pricing preserves source data, while formatModelPricing provides the common display contract used by cards and comparison without branching on dataSource.
  • CR-31e2b7e5c0f1 will not change: every current legacy pricing entry uses USD, and units are unique within each model. The conversion is lossless for the supported collection schema.

- Preserve cached pricing direction.
- Drain concurrent import work before surfacing failures.
- Record transient detail fetch failures.
- Preserve catalog focus and relayout consistency.
@allan-leinwand

Copy link
Copy Markdown
Collaborator Author

Fixed in 320faaf23d:

  • CR-afe8934fe6af: preserve cached input/output direction.
  • CR-4cf5d408ecf4 and CR-b89116b985e0: stop new dispatch after failure and await active workers.
  • CR-d251000226c3: record transport and parsing failures without aborting the import.
  • CR-0bdf7960dee4: cancel pending relayouts before synchronous layout and handle hidden documents directly.
  • CR-320325bead0e: return focus to the first cleared model control.
  • CR-026ec729c001: remove the redundant schema modifier.

Validation passed: checks, lint, formatting, 165 tests, and the 8,983-page production build.

Skip corner-mark generation when card position and column count are unchanged.

Behavior-preserving. Full checks, lint, formatting, 165 tests, and build pass.
@allan-leinwand

Copy link
Copy Markdown
Collaborator Author

Review triage for findings not changing in this pass:

  • CR-8fa534a7494a: The helper intentionally propagates callback exceptions after draining active workers. Moving the callback outside the catch would still reject the operation, but would restore immediate rejection and leave active work undrained.
  • CR-fba71c6c1f38: The helper preserves Promise.all first-error behavior. Aggregating errors would change its contract, while catalog detail fetches already convert individual request failures into result values.
  • CR-b7717008fc34: The labels use sentence case: Input starts a label, while input follows Cached. Cached Input would capitalize a word mid-label.
  • CR-1e526ede8c4c: The catalog API type defines pricing as an object or omitted, and current catalog data contains no pricing: null. Accepting speculative null values would weaken collection validation without a concrete source value.

@allan-leinwand

Copy link
Copy Markdown
Collaborator Author

Fixed in 0906eccb25:

  • CR-fdfe67d57551: The concurrency test now proves the operation remains pending until active work finishes and verifies that worker completion.
  • CR-82547596260d: Clearing comparison now focuses the first visible selected model, falling back to search when every selected card is filtered out.

@allan-leinwand

Copy link
Copy Markdown
Collaborator Author

/review

@allan-leinwand

Copy link
Copy Markdown
Collaborator Author

Superseded by #33381, which uses a branch in the upstream repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.