# checkpoints()

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/local-agent/checkpoints/
Language: zh

`agent.checkpoints() → Promise<Point[]>`

回到哪里,最古老的先——每个点都站住什么,回到什么不会消失。

Status: free · needs a session · 20 at most

```javascript
const points = await agent.checkpoints();
// [{ n: 1, at: "2026-10-07T09:12:44.000Z", text: "Rename every component…",
//    files: 184, partial: false, outside: [] },
//  { n: 2, at: "…", text: "Now update the imports.",
//    files: 184, partial: false, outside: ["write_storage"] }]
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `n` | integer |  | 信息号码 `rewind(n)` 拿着这个 |
| `at` | string |  | 拍下照片时 |
| `text` | string |  | 之前的讯息 |
| `files` | integer |  | 点记记录有多少文件 |
| `partial` | boolean |  | 工作空间大于快照所能支撑的面积。 |
| `outside` | string[] |  | **机器在这一点之后留下的** - 倒带不会撤销它 |

## 提供回放前显示的外部是 {#outside}

> **警告之前,而不是之后**
>
> 如果外部不是空的, 发生一些事情, 回到过去时不会反转, 发来的信息、 发布的网站、 保存的文字、 命令运行。 在点击之前说, 选择和惊喜之间的差别 。

```javascript
const target = points.find((p) => p.n === 2);
if (target.outside.length) {
  console.warn("Going back will not undo:", target.outside.join(", "));
}
```

## 空列表 {#empty}

| 原因 | 然后 |
| --- | --- |
| 否会 号 | `rewind()` 答答答答答答 `session_required` |
| `checkpoints: false` | `checkpoints_disabled` |
| 一个子试剂 | 没有任何保留 |
| 压缩删除了信件 | 临存对话下面的点被遗忘 |

## 二十 {#retention}

届会的最后二十条信息可以重播。 旧点被删除, 存储的内容一旦一无任何提及就会被收集。

- [rewind()](/zh/sdk/ref/local-agent/rewind): 回去 回来
- [快照的工作原理](/zh/sdk/agent/checkpoints/snapshots): 一点能维持多久

```python
points = agent.checkpoints()
# [{"n": 1, "at": "2026-10-07T09:12:44Z", "text": "Rename every component…",
#   "files": 184, "partial": False},
#  {"n": 2, "at": "…", "text": "Now update the imports.",
#   "files": 184, "partial": False}]
```

```python
target = next(p for p in points if p["n"] == 2)
if target["partial"]:
    print("Some files were not copied: going back will not restore them.")
```
