fix(canvas): 任务取消 - 向异步 Provider 传播取消并完成费用对账 (#142)

Fixes #142
This commit is contained in:
ddCat
2026-08-06 10:42:39 +08:00
parent 97e6cd6002
commit 670595a3aa
13 changed files with 634 additions and 89 deletions

View File

@@ -4,6 +4,7 @@ import { generationErrorMessage } from "@/lib/generation-error";
export type TaskStatus = "queued" | "running" | "succeeded" | "failed" | "cancelled";
export type TaskBillingStatus = "reserved" | "running" | "settled" | "refunded" | "uncertain";
export type ProviderCancelStatus = "requested" | "confirmed" | "uncertain";
export type AgentSessionStatus = "active" | "completed" | "failed";
export type BackendEnvelope<T> = {
@@ -25,6 +26,11 @@ export type GenerationTask = {
provider?: string;
model?: string;
providerRequestId?: string;
providerCancelStatus?: ProviderCancelStatus;
providerCancelError?: string;
providerCancelAttempts?: number;
providerCancelRequestedAt?: string;
providerCancelledAt?: string;
errorCode?: string;
previewUrl?: string;
previewKind?: "image" | "video";