fix: goose-sdk release compat check with new schema (#9697)
This commit is contained in:
@@ -100,7 +100,7 @@ jobs:
|
||||
cd ui/sdk
|
||||
pnpm run build:ts
|
||||
|
||||
- name: Compatibility check (TUI client ↔ goose binary)
|
||||
- name: Compatibility check (SDK client ↔ goose binary)
|
||||
env:
|
||||
GOOSE_BINARY: ${{ github.workspace }}/ui/goose-binary/goose-binary-linux-x64/bin/goose
|
||||
run: |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Compatibility smoke test: boot the freshly-built goose binary via `goose acp`
|
||||
// and call every read-only ACP method through the freshly-built SDK. The
|
||||
// generated client validates every response with Zod, so any schema drift
|
||||
// between the binary and the TUI client fails this check and blocks the
|
||||
// between the binary and the SDK client fails this check and blocks the
|
||||
// publish.
|
||||
//
|
||||
// Run with:
|
||||
@@ -41,44 +41,47 @@ const { PROTOCOL_VERSION, ndJsonStream } = await import(
|
||||
);
|
||||
|
||||
// Each entry is a read-only ACP method we expect to succeed against a fresh,
|
||||
// unconfigured goose install. Adding a new entry whenever a new read-only
|
||||
// method ships will widen the safety net for free.
|
||||
// unconfigured goose install. Platform-specific skips keep hardware-sensitive
|
||||
// checks from turning local environment quirks into publish blockers.
|
||||
const READ_ONLY_CHECKS = [
|
||||
{
|
||||
name: "GooseProvidersList",
|
||||
call: (c) => c.goose.GooseProvidersList({ providerIds: [] }),
|
||||
name: "providersList_unstable",
|
||||
call: (c) => c.goose.providersList_unstable({ providerIds: [] }),
|
||||
},
|
||||
{
|
||||
name: "GooseProvidersCatalogList",
|
||||
call: (c) => c.goose.GooseProvidersCatalogList({}),
|
||||
name: "providersCatalogList_unstable",
|
||||
call: (c) => c.goose.providersCatalogList_unstable({}),
|
||||
},
|
||||
{
|
||||
name: "GooseProvidersSetupCatalogList",
|
||||
call: (c) => c.goose.GooseProvidersSetupCatalogList({}),
|
||||
name: "providersSetupCatalogList_unstable",
|
||||
call: (c) => c.goose.providersSetupCatalogList_unstable({}),
|
||||
},
|
||||
{
|
||||
name: "GooseDefaultsRead",
|
||||
call: (c) => c.goose.GooseDefaultsRead({}),
|
||||
name: "defaultsRead_unstable",
|
||||
call: (c) => c.goose.defaultsRead_unstable({}),
|
||||
},
|
||||
{
|
||||
name: "GoosePreferencesRead",
|
||||
call: (c) => c.goose.GoosePreferencesRead({}),
|
||||
name: "preferencesRead_unstable",
|
||||
call: (c) => c.goose.preferencesRead_unstable({}),
|
||||
},
|
||||
{
|
||||
name: "GooseSourcesList",
|
||||
call: (c) => c.goose.GooseSourcesList({}),
|
||||
name: "sourcesList_unstable",
|
||||
call: (c) => c.goose.sourcesList_unstable({}),
|
||||
},
|
||||
{
|
||||
name: "GooseDictationConfig",
|
||||
call: (c) => c.goose.GooseDictationConfig({}),
|
||||
name: "dictationConfig_unstable",
|
||||
skipIf: () => process.platform === "darwin",
|
||||
skipReason:
|
||||
"skipped on macOS because local-inference Metal probing can panic before returning a schema response",
|
||||
call: (c) => c.goose.dictationConfig_unstable({}),
|
||||
},
|
||||
{
|
||||
name: "GooseDictationModelsList",
|
||||
call: (c) => c.goose.GooseDictationModelsList({}),
|
||||
name: "dictationModelsList_unstable",
|
||||
call: (c) => c.goose.dictationModelsList_unstable({}),
|
||||
},
|
||||
{
|
||||
name: "GooseConfigExtensionsList",
|
||||
call: (c) => c.goose.GooseConfigExtensionsList({}),
|
||||
name: "configExtensionsList_unstable",
|
||||
call: (c) => c.goose.configExtensionsList_unstable({}),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -150,6 +153,11 @@ try {
|
||||
console.log("[compat] ✅ initialize");
|
||||
|
||||
for (const check of READ_ONLY_CHECKS) {
|
||||
if (check.skipIf?.()) {
|
||||
console.log(`[compat] ⏭️ ${check.name} (${check.skipReason})`);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
await Promise.race([check.call(client), timeout(15_000, check.name)]);
|
||||
console.log(`[compat] ✅ ${check.name}`);
|
||||
@@ -176,7 +184,7 @@ if (failed > 0) {
|
||||
`\n[compat] ${failed} check(s) failed, ${passed} passed — refusing to publish.`,
|
||||
);
|
||||
console.error(
|
||||
"[compat] This means the TUI's generated client schema doesn't match what",
|
||||
"[compat] This means the SDK's generated client schema doesn't match what",
|
||||
);
|
||||
console.error(
|
||||
"[compat] the goose binary returns. Regenerate the SDK or fix the server DTO.",
|
||||
|
||||
Reference in New Issue
Block a user