Skip to content

fix(cli): ignore legacy models snapshots#10995

Merged
marius-kilocode merged 5 commits into
mainfrom
fix/ignore-legacy-model-snapshots
Jun 8, 2026
Merged

fix(cli): ignore legacy models snapshots#10995
marius-kilocode merged 5 commits into
mainfrom
fix/ignore-legacy-model-snapshots

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

PR #10949 migrated the generated models snapshot from JavaScript and declaration files to a JSON sidecar. Its .gitignore update replaced the legacy ignore patterns, so files left by earlier builds or generated while handling upstream OpenCode code started appearing as untracked changes.

Retain the old .js and .d.ts ignore patterns alongside the new .json pattern. The current generator still cleans up legacy files, while these rules keep working trees clean before that cleanup runs.

Root cause: #10949

@kilo-code-bot

kilo-code-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Two new commits since the previous review (cc2167fc):

  1. refactor(sdk): simplify Bun version lookup — Removes the Bun version guard added in the prior commit from packages/sdk/js/script/build.ts. This is correct: the guard was a workaround for the symptom, and the root cause is now fixed at the source level.

  2. fix(sdk): stabilize generated event ordering — Fixes the actual root cause in packages/opencode/src/bus/bus-event.ts. The effectPayloads() function now calls .toArray().sort(...) before .map(), ensuring event schemas are emitted in stable alphabetical key order regardless of module evaluation order across Bun versions. The sort comparator (a < b ? -1 : a > b ? 1 : 0) is correct. A test in packages/opencode/test/kilocode/bus/bus-event.test.ts verifies the ordering by registering test.order.z before test.order.a and asserting alphabetical output — this exercises real implementation, not mocks.

The generated artifacts (types.gen.ts, openapi.json) reflect the now-stable schema ordering as expected.

Files Reviewed (5 files)
  • packages/opencode/src/bus/bus-event.ts
  • packages/opencode/test/kilocode/bus/bus-event.test.ts
  • packages/sdk/js/script/build.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json

Reviewed by claude-4.6-sonnet-20260217 · 459,821 tokens

Review guidance: REVIEW.md from base branch main

@marius-kilocode marius-kilocode changed the title fix(cli): ignore legacy models snapshots fix: prevent generated artifact churn Jun 8, 2026
@marius-kilocode marius-kilocode changed the title fix: prevent generated artifact churn fix(cli): ignore legacy models snapshots Jun 8, 2026
@marius-kilocode marius-kilocode merged commit 65f0c3e into main Jun 8, 2026
19 checks passed
@marius-kilocode marius-kilocode deleted the fix/ignore-legacy-model-snapshots branch June 8, 2026 11:03
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.

2 participants