@acedatacloud/sdk 2026.727.2 → 2026.728.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/runtime/tasks.ts +11 -0
package/package.json
CHANGED
package/src/runtime/tasks.ts
CHANGED
|
@@ -137,6 +137,17 @@ export function taskStatus(state: Record<string, unknown>): 'succeeded' | 'faile
|
|
|
137
137
|
}
|
|
138
138
|
if (words.length > 0) return '';
|
|
139
139
|
|
|
140
|
+
// `success: false` alone is ambiguous — some services set it for a transient
|
|
141
|
+
// hiccup mid-run, alongside a bare string, and carry on. A *structured* error
|
|
142
|
+
// (a dict with a code) is the upstream's final answer: hailuo reports an
|
|
143
|
+
// unavailable model that way, with no finished_at, and treating it as still
|
|
144
|
+
// running makes the caller poll until timeout instead of showing the reason.
|
|
145
|
+
if (response.success === false) {
|
|
146
|
+
const error = response.error as Record<string, unknown> | undefined;
|
|
147
|
+
const structured = !!error && typeof error === 'object' && !!error.code;
|
|
148
|
+
if (artifactUrls(state).length > 0 || structured) return 'failed';
|
|
149
|
+
}
|
|
150
|
+
|
|
140
151
|
const finished =
|
|
141
152
|
(response.finished_at !== undefined && response.finished_at !== null) ||
|
|
142
153
|
(state.finished_at !== undefined && state.finished_at !== null);
|