Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

packages/sdk/js v2 gen tree does not round-trip: build.ts regenerates ~12k lines of types.gen.ts on main

Open
#1,148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
bun, typescript

Research direction

Run packages/sdk/js/script/build.ts on a clean main checkout and inspect the generated changes under src/v2/gen, especially types.gen.ts and sdk.gen.ts. Compare the generated tree with the committed files, then review the existing reproducibility check from the non-JSON-response work. Done means the v2 tree regenerates without a diff and the final tsc step passes.

Written by the indexing model from the issue text.

Description

What

Running packages/sdk/js/script/build.ts on a clean checkout of main regenerates src/v2/gen/types.gen.ts with a ~12k-line diff (and sdk.gen.ts changes), then fails at its trailing tsc step. The committed v2 gen tree and the output of bun dev generate + codegen have drifted apart.

Why it matters

script/publish.ts runs build.ts inside prepareReleaseFiles() on every release, so what ships in @opencode-ai/sdk/v2 is the regenerated tree — not the reviewed, committed one. Any post-codegen patch (SseFn, and the JSON-parse guard being added in the non-JSON-response PR) is only as reproducible as this tree.

Evidence

Observed while adding a "SDK codegen is reproducible" CI check for the non-JSON-response PR: the patched client/client.gen.ts round-trips byte-for-byte, but types.gen.ts does not, so the check had to be scoped to the patched file. The build's final tsc fails on the regenerated types (e.g. FileSystemEntry no longer exported).

Suggested fix

Regenerate and commit the v2 gen tree from current main, then widen the CI check to git diff --exit-code -- src/v2/gen so it can never drift silently again.

Dominant language
TypeScript
Stars
813
Forks
134
Avg merge
2d 3h
Merged PRs (30d)
65

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AltimateAI/altimate-code

All issues in AltimateAI/altimate-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.