Fix more generated-CLI behavior bugs via patches (stopgap for upstream) - #23
Merged
Merged
Conversation
Batch of behavior-bug fixes found smoke-testing the CLI, each carried as a .speakeasy/patches/ override that re-applies on every regen (pending upstream Speakeasy/spec fixes). - Pagination hint: HasMorePages now reads the response's own hasMore flag instead of the SDK's always-non-nil Next closure, so "more pages available" no longer prints after every list command (or after --dry-run). - --body -: a lone "-" now reads the body from stdin in both body paths (previously parsed as literal JSON -> "invalid character in numeric literal"). - Flag metavars: strip markdown backticks from descriptions so Cobra's UnquoteUsage stops turning a back-quoted word into the metavar placeholder (--prerequisites true -> --prerequisites stringArray). Also cleans the 50 generated doc files. - TOON/pretty output: guarantee exactly one trailing newline. - settings get: fall back to a lenient generic decode when the typed decode fails on response schema drift (e.g. updateSchedule.hours stored as a string) so the command succeeds in every format instead of hard-failing; agent mode now classifies decode errors as response_error (with an actionable hint) rather than connection_error. - get-SDK-payload / post-copy-transform: drop the doubled binary name in their examples. - v1 deprecation notice: link the full MIGRATION.md URL. Version bumped 1.1.1 -> 1.1.2 by generation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 14, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features and Changes
A second batch of stopgap fixes for behavior bugs found smoke-testing the CLI, each carried as a
.speakeasy/patches/override that re-applies on every regen (pending upstream Speakeasy/spec fixes). Follows #14.HasMorePagesnow reads the response body's ownhasMoreflag instead of the SDK'sNextclosure, which is assigned unconditionally and so was always non-nil — the "more pages available" hint printed after every list command, and even after--dry-run. Now it prints only when more pages actually exist.--body -reads stdin. A lone-was parsed as literal JSON (invalid character '-' in numeric literal). It now follows the Unix idiom and reads the body from stdin, in both the whole-body and per-field body paths.UnquoteUsagetreats the first back-quoted word in a flag's description as the metavar placeholder, so markdown backticks in spec descriptions produced junk like--prerequisites true,--rules allEnvironments.RegisterFlagsnow strips backticks before registration →--prerequisites stringArray,--rules string. This also cleans the 50 regenerated doc files.settings getschema drift. Org settings can hold values that don't match the strict typed schema (e.g.updateSchedule.hoursstored as a string). The command now falls back to a lenient generic decode so it succeeds in every output format instead of hard-failing. In agent mode, a response-decode error is classified asresponse_errorwith an actionable hint rather thanconnection_error/ "check network connectivity".get-SDK-payloadandpost-copy-transformexamples no longer readgrowthbook growthbook <cmd>.MIGRATION.mdURL.Generation bumped the version
1.1.1→1.1.2.--body -and the metavar change alter user-facing flag behavior/help (and the docs surface), though neither is a breaking change for existing scripts.Upstream tracking
Each class of bug has a tracking issue so we know what's still waiting on upstream and how to retire the patch (not auto-closed by this PR — the patches are stopgaps): #24 (pagination hint), #25 (
--body -), #26 (backtick metavars), #27 (trailing newline), #28 (agent-mode decode classification), #29 (doubled binary name), #30 (--usageKDL — unpatched), #31 (settings.hours — back-end/spec).Known issues (deferred)
--usageKDL still liststable. A patch for this conflicts on every version bump (thetablestring shares the single 260 KB KDL line withversion "1.1.1"), so it's un-shippable as a stable patch. Human-facing--helpis already correct; only the machine-readable schema is affected. Best fixed upstream.settings.hourstyping — the root fix (typehoursto tolerate a string, or coerce in the back-end) belongs in the spec; tracked separately. This PR only makes the CLI degrade gracefully.Testing
speakeasy runapplies all 8 code patches cleanly; staticcheck +go test ./...pass; binary builds (growthbook 1.1.2).go generate ./...— command-surface golden refreshed.echo '{"id":"test"}' | growthbook features create --body - --dry-run→ body populated from stdin (no parse error).growthbook features create --help→ metavars render asstring/stringArray, backticks gone.growthbook --help→ output-format no longer liststable.