Skip to content

RestoreResult

This content is not available in your language yet.

type RestoreResult =
| {
checkpointId: string;
fromMessages: number;
preRestoreCheckpointId?: string;
status: "restored";
toMessages: number;
}
| {
reason: "turn_running" | "not_found" | "session_mismatch" | "store_not_wired";
status: "rejected";
};

restore() 结果联合(restored / rejected)

{
checkpointId: string;
fromMessages: number;
preRestoreCheckpointId?: string;
status: "restored";
toMessages: number;
}
checkpointId: string;
fromMessages: number;

恢复前历史消息数

optional preRestoreCheckpointId?: string;

恢复前自动落的 pre_restore 快照 id(options.checkpoint !== false 时在场)

status: "restored";
toMessages: number;

恢复后历史消息数(= 快照 messageCount)


{
reason: "turn_running" | "not_found" | "session_mismatch" | "store_not_wired";
status: "rejected";
}
reason: "turn_running" | "not_found" | "session_mismatch" | "store_not_wired";

turn_running = 运行中 / not_found = 本会话下无此快照 / session_mismatch = 快照 属于别的会话(跨会话恢复 = 越界;请用 fork)/ store_not_wired = 快照存储未接线

status: "rejected";