Skip to content

fix(opencode): skip typechecking generated models snapshot#19018

Merged
kitlangton merged 1 commit intodevfrom
kit/models-snapshot-typecheck
Mar 24, 2026
Merged

fix(opencode): skip typechecking generated models snapshot#19018
kitlangton merged 1 commit intodevfrom
kit/models-snapshot-typecheck

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • generate the models snapshot as models-snapshot.js plus a tiny models-snapshot.d.ts instead of a giant models-snapshot.ts as const
  • add // @ts-nocheck to the generated JS payload so TypeScript treats the snapshot as opaque data
  • keep runtime behavior the same while avoiding a large typecheck cliff after running the build script

Benchmarks

  • with a generated models-snapshot.ts as const on origin/dev: tsc --noEmit --extendedDiagnostics took about 89s, tsgo --noEmit --incremental false --extendedDiagnostics took about 3.57s
  • with this patch and a generated models-snapshot.js + models-snapshot.d.ts: tsc --noEmit --extendedDiagnostics took about 23s, tsgo --noEmit --incremental false --extendedDiagnostics took about 2.42s
  • a clean checkout without generated snapshot artifacts is already fast; this fixes the slowdown that appears after the snapshot is generated locally

@kitlangton kitlangton merged commit 50f6aa3 into dev Mar 24, 2026
11 checks passed
@kitlangton kitlangton deleted the kit/models-snapshot-typecheck branch March 24, 2026 23:11
Andres77872 pushed a commit to Andres77872/opencode that referenced this pull request Mar 26, 2026
balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant