检查点

概览

工作空间在您每次发信息之前都被拍照。 回到一个文件时, 将每个文件都完全置于原样, 并直截了当地说出它无法撤销的东西。

on by defaultneeds a session20 kept
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

撤消日志对代理器不起作用。 命令书写的文件没有前一版本, 在一个事实之后创建的文件“ ” 之前没有“ ” , 重命名没有反转。 因此引擎保存一个快照, 而不是一个反转列表 。

使用它

const agent = api.agents.create({
  runtime: "local", machine: pc, model: "gemini-3.5-flash",
  memory: true,                        // checkpoints need a session
  mode: "auto",
});

await agent.run({ inputs: "Rename every component to PascalCase." });
await agent.run({ inputs: "Now update the imports." });

const points = await agent.checkpoints();
// [{ n: 1, at, text: "Rename every component…", files: 184, partial: false, outside: [] },
//  { n: 2, at, text: "Now update the imports.",  files: 184, partial: false, outside: [] }]

await agent.rewind(2);     // back to just before the second message
agent = api.agents.create(
    runtime="local", machine=pc, model="gemini-3.5-flash",
    memory=True,                         # checkpoints need a session
    mode="auto",
)

agent.run(inputs="Rename every component to PascalCase.")
agent.run(inputs="Now update the imports.")

points = agent.checkpoints()
# [{"n": 1, "at", "text": "Rename every component…", "files": 184, "partial": False},
#  {"n": 2, "at", "text": "Now update the imports.",  "files": 184, "partial": False}]

agent.rewind(2)     # back to just before the second message

一点是信息,不是一步

n 计数 您的 返回到 n 恢复该信件之前的文件,从对话、设备日记和账户中删除信件和之后的所有内容。

后回回缩报告

{
  n: 2,
  removed: { messages: 11, turns: 5 },
  files: { restored: [...], recreated: [...], deleted: [...], skipped: [...] },
  kept: ["send_mail", "deploy"],           // what left the machine and stays done
  credits: { spent: 24, refunded: 0 }
}
{
    "n": 2,
    "files": {"restored": [...], "recreated": [...], "deleted": [...], "skipped": [...]},
    "kept": [],                          # what left the machine and stays done
    "credits": {"spent": 0, "refunded": 0},
}
并退还:0是诚实的部分

发送了一条信息。一个网站在网上公布。 已经花费的信用被花费了。 答案不是让“ 倒回 ” , 而是让他们的名字, 意味着世界被放回了。

需要的东西

所需否则
memory: truesession_required - 没有任何届会可附加点数。
目前未回答agent_running - 打电话 stop() 头一个。
checkpoints 未关机checkpoints_disabled.
不是子试剂亚试剂没有保留任何内容:它没有自己的谈话可剪切。

关掉它

api.agents.create({ runtime: "local", machine: pc, model, memory: true, checkpoints: false });
api.agents.create(runtime="local", machine=pc, model=model, memory=True, checkpoints=False)

在一个巨大的工作空间上,或者在储存配额比返回更重要的地方,一个无法接受的快照永远无法阻挡一个答案,却被跳过,而运行仍在继续。