Repository navigation
chore: upgrade typecheck to TypeScript 7.0.2 - #56300
Conversation
There was a problem hiding this comment.
This works as described. On the PR head, typecheck passes in core, tui, app, session-ui, cli, plugin, ui, desktop, server and sdk. The core database migration tests (22 pass), the core build and bun run lint (including sdk-docs on the TS 6 API) also pass, and nothing still refers to tsgo or native-preview. These checks were not rerun on the base for comparison.
Public API is unchanged. This is dev tooling and tsconfig only, plus two type-only code tweaks with no runtime change.
One thing to be aware of: packages/desktop depends on both its own typescript ~5.6.2 and @typescript/native, and both provide a tsc command. Bun linked the 7.0.2 one, so its tsc -b currently runs TS 7.0.2 and passes. That relies on which package wins the command clash, and it doesn't match the description's "keeps its own pinned typescript" for type checking. If 7.0.2 is the one you want there, dropping or aligning desktop's own typescript pin would remove the ambiguity.
Related: #49224
Replace the December @typescript/native-preview dev build with the TypeScript 7.0.2 release using the side-by-side layout from the 7.0 release notes: @typescript/native provides the native tsc, and typescript resolves to @typescript/typescript6 for tools that need the JavaScript compiler API.
Give the root and containers configs @types/bun, keep desktop's typescript on the catalog so tsc resolves to TypeScript 7 only, declare the CSS package exports instead of disabling noUncheckedSideEffectImports, scope http-recorder's src types to node, and point the typecheck profiler at tsc.
oxlint ignores .d.ts files, so a change touching only declaration files made it print a plain-text message that lint:changed then failed to parse as JSON.
0b14827 to
3e10b3f
Compare
Merges anomalyco/opencode `dev` at 501b15a ("docs: point README install methods at V2", 2026-10-18). Upstream promoted V2 to `dev` on 2026-10-10 (5caf1f9); `v2` stays frozen at 4617210, the previous merge base. 64 files conflicted. Resolution rules: - Typecheck moves to TypeScript 7 (`tsc`, `@typescript/native`, anomalyco#56300), including the Plus-only `plus` and `cliproxyapi` packages; their test config roots at `packages/` because TypeScript 7 enforces `rootDir`. - Test scripts keep our `--parallel` runs and timings and add upstream's flags (`--timeout=30000`). - Config watching keeps our service-wide-only policy (no per-folder watchers) and adds upstream's system config directory, configured `instructions` entries and remote instruction URLs. - Config file references keep our managed-placement reader: a placed config still fails closed on a reference it cannot read, a local one now substitutes empty with a warning, as upstream intends. - `SessionGenerate.generate` keeps our observation and warming path without upstream's `ModelRetry`: warming has its own retry, and a retry inside the observed call would put several wire requests under one invocation. Upstream's retry test for that path is left out. - Plugin host and APIs keep `config.reload` and add upstream's `credential.activate`, `session.list` and `permission.assert`. - The updater keeps the OpenCodePlus installer method first and adds WinGet; the service port keeps the Plus channel and adds the Windows port shift. - The CLI build keeps our build-identity refactor and adds release highlights and the native-architecture check. - The TUI update dialog takes upstream's new layout with our product-aware wording; footer hints follow upstream's action-then-key order. - `@modelcontextprotocol/sdk` keeps sharing the catalog `zod`. - `packages/cli/package.json` dependency keys stay in bun canonical order.
Moves type checking off the December
@typescript/native-previewdev build (7.0.0-dev.20251207.1) and onto the TypeScript 7.0.2 release.Layout
TypeScript 7.0 ships a native
tscbut no JavaScript compiler API, so this uses the side-by-side setup from the 7.0 release notes:@typescript/native→npm:typescript@7.0.2providestsc. Everytypecheckscript now runstscinstead oftsgo, and thebun tsc -p tsconfig.build.jsonlibrary builds use it too.typescript→npm:@typescript/typescript6@6.0.2(exposestsc6) for code that imports the compiler API: Astro check,script/sdk-docs.ts, and similar tools. Before this change they got 5.8.2.packages/desktopmoves from its owntypescript@~5.6.2to the catalog entry, because itstscbinary would otherwise collide with TS 7's.sdks/vscodeandgithub/are outside the workspace and keep their own pinned versions. The root package gains@types/bunfor the root andpackages/containersconfigs.TS 6/7 default changes
typesnow defaults to[]: added"types": ["bun"]to the Bun-based tsconfigs that relied on implicitly visible@types.packages/appgets["bun", "node"], matching what was visible before.http-recordersources get["node"]and its tests get["bun"].rootDirno longer inferred:packages/appincludes../storybook/playwright/*.ts, so it now sets"rootDir": "..", the root that used to be inferred. The no-emitapp/e2econfig widens to../..for the same reason.noUncheckedSideEffectImportsnow defaults totrue: a session-ui perf fixture imports@opencode/ui/stylesCSS through package exports that don't end in.css, so those two specifiers get an ambient declaration. The check stays on.Code fixes from stricter inference
core/database/migration.ts:restoreForeignKeyswas a union ofSQLiteEffectRaw<…>andEffect<void>. TS 7.0.2 no longer resolves.pipe(Effect.orDie)on that union, which left the database layer's requirements asunknown. Both branches are nowEffect<void>viaEffect.asVoid. No runtime change.script/profile-typecheck.tsnow countstscprocesses instead oftsgo.tui/terminal-pane.tsx:sendtakesUint8Array<ArrayBuffer>, the typeinteractionFrameactually returns, to satisfy DOMWebSocket.send'sBufferSource.Verification
typecheckpasses, same asdev. On this host the Astro checks need Bun as the runtime because Node is old (bun --bun x astro check); posts and www pass under TS 6.0.3.bun run lintpasses, includingsdk-docson the TS 6 API.bun turbo build --filter='@opencode/cli^...' --filter='@opencode/app^...'passes: 3m08s ondev, 38s here, sequential on the same machine. The emitted.d.tskeep the same file set. Diffs are member order and type printing, andanyoccurrences drop (for example, ai 437 → 137, core 228 → 159).bun test test/database-migration.test.ts test/database.test.tsin core: 22 pass.apptypecheck:e2ehas the same 4 errors it already has ondev.Requested by: @kitlangton (Kit via Slack)