Skip to content

fix(llm-model-catalog): format generated files so they stop showing as modified#4170

Open
1stvamp wants to merge 1 commit into
mainfrom
fix/catalog-generate-format
Open

fix(llm-model-catalog): format generated files so they stop showing as modified#4170
1stvamp wants to merge 1 commit into
mainfrom
fix/catalog-generate-format

Conversation

@1stvamp

@1stvamp 1stvamp commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Anyone running pnpm run db:migrate locally ended up with defaultPrices.ts and modelCatalog.ts in llm-model-catalog showing as modified every time, a ~10k-line diff that only ever changed formatting. This makes the generator format its own output so regeneration is a clean no-op.

Root cause

The root db:migrate script ends in && turbo run generate, which runs the generate script in every package that has one, including this one. The generator wrote its output with plain JSON.stringify (quoted keys, no trailing commas), but the checked-in files had been through oxfmt (unquoted keys, trailing commas). So the generator output never matched what was committed, even though the parsed data was identical.

Fix

Run oxfmt over the generated files as the last step of generate.mjs. Verified idempotent: two generate runs in a row leave the .ts files untouched.

No changeset: internal package, dev tooling only, no runtime or public API change.

@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e07d3cb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ece53b67-e1ad-45db-ae2e-6c20591b4fd4

📥 Commits

Reviewing files that changed from the base of the PR and between 7f1a026 and e07d3cb.

📒 Files selected for processing (1)
  • internal-packages/llm-model-catalog/scripts/generate.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal-packages/llm-model-catalog/scripts/generate.mjs
📜 Recent review details
⏰ Context from checks skipped due to timeout. (26)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: code-quality / code-quality
  • GitHub Check: Analyze (javascript-typescript)
⚠️ CI failures not shown inline (4)

GitHub Actions: 📝 Agent Instructions Audit / audit: fix(llm-model-catalog): format generated files so they stop showing as modified

Conclusion: failure

View job details

##[group]Run anthropics/claude-code-action@428971d2ecd6e3a7cb0ee0da2a3a8b33fdb3678d
 with:
   anthropic_***REDACTED***
   use_sticky_comment: true
   allowed_bots: devin-ai-integration[bot]
   claude_args: --max-turns 25
--model claude-opus-4-8
--allowedTools "Read,Glob,Grep,Bash(git diff:*)"
   prompt: You are reviewing a PR to check whether any agent instruction files need updating.
In this repo:
- Root shared agent guidance lives in `AGENTS.md`.
- Root `CLAUDE.md` is only a Claude Code adapter that imports `AGENTS.md`.
- Subdirectories may still have scoped `CLAUDE.md` files.
- `.claude/rules/` contains additional Claude Code guidance.
## Your task
1. Run `git diff origin/main...HEAD --name-only` to see which files changed in this PR.
2. For each changed directory, check the applicable instruction files: root `AGENTS.md`, any `CLAUDE.md` in that directory or a parent directory, and relevant `.claude/rules/` files.
3. Determine if any instruction file should be updated based on the changes. Consider:
   - New files/directories that aren't covered by existing documentation
   - Changed architecture or patterns that contradict current agent guidance
   - New dependencies, services, or infrastructure that agents should know about
   - Renamed or moved files that are referenced in an instruction file
   - Changes to build commands, test patterns, or development workflows
## Response format
If NO updates are needed, respond with exactly:
✅ Agent instruction files look current for this PR.
If updates ARE needed, respond with a short list:
📝 **Agent instruction updates suggested:**
- `AGENTS.md`: [what should be added/changed]
- `path/to/CLAUDE.md`: [what should be added/changed]
- `.claude/rules/file.md`: [what should be added/changed]
Keep suggestions specific and brief. Only flag things that would actually mislead agents in future sessions.
Do NOT suggest updates for trivial changes (bug fixes, small refactors within existing patterns).
Do NOT suggest creating new...

GitHub Actions: 📝 Agent Instructions Audit / 0_audit.txt: fix(llm-model-catalog): format generated files so they stop showing as modified

Conclusion: failure

View job details

 `@trigger.dev/yalt`@3.0.0-beta.48 -> `@trigger.dev/yalt`@3.0.0-beta.48
  * [new tag]             `@trigger.dev/yalt`@3.0.0-beta.49 -> `@trigger.dev/yalt`@3.0.0-beta.49
  * [new tag]             `@trigger.dev/yalt`@3.0.0-beta.5 -> `@trigger.dev/yalt`@3.0.0-beta.5
  * [new tag]             `@trigger.dev/yalt`@3.0.0-beta.50 -> `@trigger.dev/yalt`@3.0.0-beta.50
  * [new tag]             `@trigger.dev/yalt`@3.0.0-beta.51 -> `@trigger.dev/yalt`@3.0.0-beta.51
  * [new tag]             `@trigger.dev/yalt`@3.0.0-beta.52 -> `@trigger.dev/yalt`@3.0.0-beta.52
  * [new tag]             `@trigger.dev/yalt`@3.0.0-beta.53 -> `@trigger.dev/yalt`@3.0.0-beta.53
  * [new tag]             `@trigger.dev/yalt`@3.0.0-beta.55 -> `@trigger.dev/yalt`@3.0.0-beta.55
  * [new tag]             `@trigger.dev/yalt`@3.0.0-beta.6 -> `@trigger.dev/yalt`@3.0.0-beta.6
  * [new tag]             `@trigger.dev/yalt`@3.0.0-beta.7 -> `@trigger.dev/yalt`@3.0.0-beta.7
  * [new tag]             build-alert-hotfix.rc1      -> build-alert-hotfix.rc1
  * [new tag]             build-alert-hotfix.rc2      -> build-alert-hotfix.rc2
  * [new tag]             build-arm-builds-rc.1       -> build-arm-builds-rc.1
  * [new tag]             build-arm-builds-rc.2       -> build-arm-builds-rc.2
  * [new tag]             build-arm-builds-rc.3       -> build-arm-builds-rc.3
  * [new tag]             build-batchid-carryover-rc.0 -> build-batchid-carryover-rc.0
  * [new tag]             build-batching-rc.1         -> build-batching-rc.1
  * [new tag]             build-batching-rc.2         -> build-batching-rc.2
  * [new tag]             build-billing-0.0.1         -> build-billing-0.0.1
  * [new tag]             build-billing-0.0.2         -> build-billing-0.0.2
  * [new tag]             build-billing-0.0.3         -> build-billing-0.0.3
  * [new tag]             build-buildinfo-rc.0        -> build-buildinfo-rc.0
  * [new tag]             build-buildinfo-rc.1        -> build-buildinfo-rc.1
  * [new tag]             build-checkpoint-failover-rc.1 -> build-checkpo...

GitHub Actions: 🔎 REVIEW.md Drift Audit / 0_audit.txt: fix(llm-model-catalog): format generated files so they stop showing as modified

Conclusion: failure

View job details

ix-registry-proxy    -> build-fix-registry-proxy
  * [new tag]             build-graphile-upgrade-rc.1 -> build-graphile-upgrade-rc.1
  * [new tag]             build-hotfix-2024-10-06.1   -> build-hotfix-2024-10-06.1
  * [new tag]             build-hotfix-2024-10-06.2   -> build-hotfix-2024-10-06.2
  * [new tag]             build-hotfix-bulk-replay-region -> build-hotfix-bulk-replay-region
  * [new tag]             build-hotfix-dequeue-gate   -> build-hotfix-dequeue-gate
  * [new tag]             build-hotfix-queue-contention.rc1 -> build-hotfix-queue-contention.rc1
  * [new tag]             build-hotfix-unflatten.rc1  -> build-hotfix-unflatten.rc1
  * [new tag]             build-hotfix-wq-len         -> build-hotfix-wq-len
  * [new tag]             build-lazy-attempts-rc.1    -> build-lazy-attempts-rc.1
  * [new tag]             build-lazy-attempts-rc.2    -> build-lazy-attempts-rc.2
  * [new tag]             build-lazy-attempts-rc.3    -> build-lazy-attempts-rc.3
  * [new tag]             build-lazy-attempts-rc.4    -> build-lazy-attempts-rc.4
  * [new tag]             build-lazy-attempts-rc.5    -> build-lazy-attempts-rc.5
  * [new tag]             build-legacy-run-engine.fix1 -> build-legacy-run-engine.fix1
  * [new tag]             build-legacy-run-engine.fix2 -> build-legacy-run-engine.fix2
  * [new tag]             build-legacy-run-engine.fix3 -> build-legacy-run-engine.fix3
  * [new tag]             build-manual-checkpoints.rc1 -> build-manual-checkpoints.rc1
  * [new tag]             build-metadata-upgrade-logging.rc1 -> build-metadata-upgrade-logging.rc1
  * [new tag]             build-metadata-upgrade-logging.rc2 -> build-metadata-upgrade-logging.rc2
  * [new tag]             build-metadata-upgrade-logging.rc3 -> build-metadata-upgrade-logging.rc3
  * [new tag]             build-new-build-system.rc.1 -> build-new-build-system.rc.1
  * [new tag]             build-otel-upgrade-rc.0     -> build-otel-upgrade-rc.0
  * [new tag]             build-otel-upgra...

GitHub Actions: 🔎 REVIEW.md Drift Audit / audit: fix(llm-model-catalog): format generated files so they stop showing as modified

Conclusion: failure

View job details

##[group]Run anthropics/claude-code-action@428971d2ecd6e3a7cb0ee0da2a3a8b33fdb3678d
 with:
   anthropic_***REDACTED***
   use_sticky_comment: true
   allowed_bots: devin-ai-integration[bot]
   claude_args: --max-turns 30
--allowedTools "Read,Glob,Grep,Bash(git diff:*)"
   prompt: You are auditing this PR for drift against `.claude/REVIEW.md`.
## Context
`.claude/REVIEW.md` is the repo's source of truth for what AI / agent code reviewers should treat as critical findings (rolling-deploy safety, hot-table indexes, recovery-path queries, testcontainers usage, Lua versioning, etc.). It is consumed by review agents to calibrate severity. If REVIEW.md goes stale, every future agent review degrades.
## Strategy — read this first
You have a hard turn budget. Spend it on signal, not coverage. The audit is allowed to miss things; it is NOT allowed to time out.
1. Read `.claude/REVIEW.md` once, in full.
2. Run `git diff origin/main...HEAD --name-only` to get the list of changed files. Do NOT read the diff content yet.
3. Scan the file-list for relevance to REVIEW.md scope. Relevance signals: changes to Prisma schema, Redis / queue / Lua code, hot tables, recovery / restart loops, new packages, deletions of paths REVIEW.md cites. Skim everything else.
4. Open at most **5 files** total — only the ones most likely to surface a real signal. If nothing in the file-list looks relevant to any REVIEW.md rule, do NOT read any files; go straight to the verdict.
5. Form a verdict and stop. Do not exhaust the turn budget exploring.
Large PRs (>50 files changed) are a strong signal to be MORE selective, not more thorough. Pick 3-5 files at most.
## What to look for
- **Stale references** — does any REVIEW.md rule cite a file, directory, function, table, Prisma model, or package name that has been removed or renamed in this PR (or is already gone from `main`)?
- **Contradictions** — does code in this PR clearly violate a current REVIEW.md rule? (Don't re-review the PR. Only flag if REVIE...

Walkthrough

Changes

The generate.mjs script in internal-packages/llm-model-catalog/scripts now imports execFileSync and tracks generated output paths in a written array. Both defaultPrices.ts and modelCatalog.ts writes now use computed outPath values that are recorded for later processing. After generation, the script runs pnpm exec oxfmt on the collected paths when any files were written, and logs how many files were formatted. Files skipped because source JSON is missing are not added to written.

Sequence Diagram(s)

Not applicable; the change is limited to script-local file generation and formatting flow.

Estimated code review effort: 2 (Medium)

Related issues: None specified.

Related PRs: None specified.

Suggested labels: internal-tooling, scripts

Suggested reviewers: None specified.

Poem:
A script that writes, then tidies its trail,
Each path recorded, no detail shall fail,
Oxfmt steps in to smooth every line,
Generated files now format just fine.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, but it misses required template sections like Closes #issue, checklist, testing, changelog, and screenshots. Add the missing template sections: Closes #issue, checklist, testing steps, changelog, and screenshots, or mark them N/A if not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change to format generated llm-model-catalog files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/catalog-generate-format

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@1stvamp 1stvamp self-assigned this Jul 6, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

coderabbitai[bot]

This comment was marked as resolved.

…s modified

generate.mjs wrote defaultPrices.ts and modelCatalog.ts with raw JSON.stringify
(quoted keys, no trailing commas), but the committed files were oxfmt-formatted,
so the generator output never matched HEAD. Any 'turbo run generate' (e.g. via
'pnpm run db:migrate') left both files dirty with an identical-data diff. Run
oxfmt on the output as the final generate step so regeneration is a no-op.
@1stvamp 1stvamp force-pushed the fix/catalog-generate-format branch from 7f1a026 to e07d3cb Compare July 6, 2026 15:35
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