[Core] Add Factory Pause Checkpoints - #2537
Conversation
This comment has been minimized.
This comment has been minimized.
2dc7880 to
71666ea
Compare
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
71666ea to
295bd38
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Public factory documentation remains inconsistent with resumable paused runs, and one new error message is malformed.
Get a fresh assessment by requesting another Copilot review.
Review tier: Balanced
Findings: 2
Open findings (2)
What changed in this PR
Adds Node.js factory pause checkpoints, resumable pause semantics, token-scoped cancellation, and nullable invocation-limit overrides.
Changes:
- Adds public and contextual pause APIs.
- Scopes aborts to execution tokens.
- Adds pause, resume-limit, and cancellation tests.
| File | Description |
|---|---|
nodejs/src/session.ts |
Implements pause checkpoints and token-scoped aborts. |
nodejs/src/factory.ts |
Defines pause and limit-override APIs. |
nodejs/src/index.ts |
Exports the limit-override type. |
nodejs/test/factory.test.ts |
Tests pause, resume, and abort behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2d06445-b3d6-4328-834f-81fceb95019c
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2d06445-b3d6-4328-834f-81fceb95019c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2d06445-b3d6-4328-834f-81fceb95019c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a2d06445-b3d6-4328-834f-81fceb95019c
SDK Consistency ReviewScope of PR #2537: All 6 changed files are within
What changed: This PR extends the "Agent Factories" API by adding a Cross-SDK check: I verified that the Agent Factories API ( Conclusion: ✅ No cross-SDK consistency issue. Since Agent Factories is currently a Node.js-only experimental feature, extending it further in Node.js alone does not create a parity gap — there is no equivalent surface in other SDKs to keep in sync with. Naming (
|

What
Adds token-scoped factory pause and durable checkpoint APIs to the Node.js SDK after the runtime contract lands. A paused attempt settles its waiter while resume preserves invocation limit overrides and execution identity.
Why
Factory authors need a safe checkpoint that stops spend without losing completed work. Token-scoped aborts stop an old attempt from cancelling a resumed attempt with the same run ID.