Skip to content

Regenerate SDK from serverside-api v235.0.0 and fix generate.sh leftovers - #77

Merged
slavabobik merged 3 commits into
mainfrom
chore/regenerate-sdk-prune-stale-models
Aug 5, 2026
Merged

Regenerate SDK from serverside-api v235.0.0 and fix generate.sh leftovers#77
slavabobik merged 3 commits into
mainfrom
chore/regenerate-sdk-prune-stale-models

Conversation

@slavabobik

Copy link
Copy Markdown
Contributor

Summary

./generate.sh was failing partway through and leaving the working tree in a broken, half-generated state. This fixes the script and lands a fresh generation from the current spec.

Why it failed: building chat-manager pulls in a very large Go dependency graph and needs tens of GB of scratch space. When it ran out, the Go compiler died with no space left on device — but only after the generator had already written part of its output, so every failed attempt left untracked leftovers behind.

Why leftovers accumulated: the script never removed anything before regenerating. Models dropped from the spec upstream simply stayed on disk forever. This regeneration prunes 124 such classes that no longer exist in serverside-api.yaml.

generate.sh changes

  • Check free space on TMPDIR and the repo up front, and fail with a hint instead of dying mid-build.
  • Build the generator before touching the SDK tree, so a compile failure can't leave partial output.
  • Wipe generated models and webhook fixtures before regenerating, so stale schemas and events don't survive. models/framework is hand-written and deliberately preserved.
  • Roll generated sources back via git if any generation step fails. The trap is released once output is coherent, so a compile failure is left in place to inspect rather than silently reverted.
  • set -euo pipefail, resolve paths from the script location, and only apply the CallParticipant patch when that model is actually generated (it no longer is, which was printing an error on every run).

Regenerated output

Generated from chat at a3178a8796 (Release v235.0.0).

  • New importer external storage endpoints on Common
  • New models: ChannelContextResponse, DeleteUserMessagesRequestPayload, GetExternalStorageGCSResponse, UpsertExternalStorageGCSRequest, ModerationAnalysisFailedEvent
  • Removed 124 stale model classes absent from the spec and unreferenced by the client

Test plan

  • ./generate.sh runs end to end, BUILD SUCCESSFUL
  • ./gradlew compileTestJava passes, so no test source referenced a pruned model
  • Offline unit tests pass (241/242; the one failure is StreamHTTPClientTest needing STREAM_API_KEY/STREAM_API_SECRET, and it passes once those are set)
  • Rollback verified by injecting a failure into the generation step: all 1547 models, the 8 hand-written models/framework files, and the fixtures were restored, and a planted untracked leftover was cleaned up
  • Disk preflight verified via MIN_FREE_GB=999999 ./generate.sh, which exits 1 with the reclaim hint
  • CI green

Note for reviewers

The 124 deletions are public classes, so this is technically a breaking change for anyone importing them. They were unreachable dead code — no endpoint returns or accepts them, and nothing in the client or tests references them.

I also had to install a Java 21 toolchain locally to build; the repo pins JavaLanguageVersion.of(21) and only JDK 25/26 were present. Nothing in the repo needed changing for that.

Made with Cursor

Slava Bobik and others added 2 commits August 5, 2026 11:37
Regenerating the SDK left the tree in a broken state whenever anything went
wrong. Building chat-manager needs tens of GB of scratch space, and when the Go
compiler ran out it died with "no space left on device" partway through, after
the generator had already written part of the output.

Check for free space before starting, build the generator before touching the
SDK tree, and roll generated sources back if any step fails. Models and webhook
fixtures are now wiped before regenerating so schemas dropped from the spec stop
surviving as stale sources, and the CallParticipant patch only applies when that
model is actually generated.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds the importer external storage endpoints, GCS external storage models, and
the moderation analysis failed event, and prunes 124 model classes that no
longer exist in the spec. Those were leftovers from earlier runs: generate.sh
never removed generated files, so schemas kept accumulating after being dropped
upstream. None of them are referenced by the client.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread generate.sh Outdated
Comment thread generate.sh
Comment thread generate.sh Outdated
Addresses review on #77.

Rollback only covered models and fixtures, so a failure partway through
generate-client could leave a half-written services/Common.java behind — the
state the rollback exists to prevent. It also restored from the index, which
silently discarded uncommitted edits and untracked files.

Snapshot every path the generator writes before the wipe and restore from that
instead. Recovering the actual pre-run contents preserves local work and keeps
re-runs on a dirty tree working, so no clean-worktree gate is needed.

The disk check now probes the Go build and module caches and $HOME as well.
Those are where the space actually goes, and they need not share a volume with
the repo or TMPDIR, so the old check could pass while the real target was full.
Results are deduplicated per filesystem, and the default floor is 30GB since the
build wants 20-30GB and 20 was too close to the line to be useful.

Co-authored-by: Cursor <cursoragent@cursor.com>
@slavabobik
slavabobik merged commit d9b7e7f into main Aug 5, 2026
4 checks passed
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