Skip to content

[Core] Add Factory Pause Checkpoints - #2537

Merged
MRayermannMSFT merged 7 commits into
mainfrom
mrayermannmsft-factory-pause-sdk
Sep 14, 2026
Merged

MRayermannMSFT merged 7 commits into
mainfrom
mrayermannmsft-factory-pause-sdk

Conversation

@MRayermannMSFT

Copy link
Copy Markdown
Contributor

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.

@github-actions

This comment has been minimized.

@MRayermannMSFT
MRayermannMSFT force-pushed the mrayermannmsft-factory-pause-sdk branch from 2dc7880 to 71666ea Compare September 9, 2026 16:09
@github-actions

This comment has been minimized.

MRayermannMSFT and others added 3 commits September 11, 2026 13:59
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>
@MRayermannMSFT
MRayermannMSFT force-pushed the mrayermannmsft-factory-pause-sdk branch from 71666ea to 295bd38 Compare September 11, 2026 21:02
@github-actions

This comment has been minimized.

@MRayermannMSFT
MRayermannMSFT marked this pull request as ready for review September 12, 2026 00:13
Copilot AI balanced review requested due to automatic review settings September 12, 2026 00:13
@MRayermannMSFT
MRayermannMSFT requested a review from a team as a code owner September 12, 2026 00:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Low severity

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.

Comment thread nodejs/src/factory.ts Outdated
Comment thread nodejs/src/session.ts Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a2d06445-b3d6-4328-834f-81fceb95019c
@github-actions

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
Comment thread nodejs/test/e2e/fixtures/factory-extension.mjs Fixed
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a2d06445-b3d6-4328-834f-81fceb95019c
@github-actions

Copy link
Copy Markdown
Contributor

SDK Consistency Review

Scope of PR #2537: All 6 changed files are within nodejs/ only:

  • nodejs/docs/factories.md
  • nodejs/src/factory.ts
  • nodejs/src/index.ts
  • nodejs/src/session.ts
  • nodejs/test/e2e/factory.e2e.test.ts
  • nodejs/test/e2e/fixtures/factory-extension.mjs
  • nodejs/test/factory.test.ts

What changed: This PR extends the "Agent Factories" API by adding a pause() checkpoint mechanism (ctx.pause(key), SessionFactoryApi.pause(runId), a new paused terminal-ish run status), and renames the FactoryLimits type to FactoryLimitOverrides for clarity.

Cross-SDK check: I verified that the Agent Factories API (session.factory.*, FactoryRunResult, FactoryContext, etc.) does not exist in any other language SDK — Python (python/copilot/), Go (go/), .NET (dotnet/src/), Java (java/sdk/src/main/java/), and Rust (rust/src/) all have no factory-related public API surface. The feature's own documentation (nodejs/docs/factories.md) states it is experimental, and it appears to have been introduced Node-only from its initial commit.

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 (pause, paused, FactoryLimitOverrides) and structure are consistent with existing conventions already used in factory.ts (e.g., cancel/cancelled, resume). No action needed for other language SDKs at this time.

Generated by SDK Consistency Review Agent for #2537 · copilot · sonnet50 · 40.1 AIC · ⌖ 12.2 AIC · ⊞ 8.3K ·

@MRayermannMSFT
MRayermannMSFT added this pull request to the merge queue Sep 14, 2026
Merged via the queue into main with commit 557e496 Sep 14, 2026
42 checks passed
@MRayermannMSFT
MRayermannMSFT deleted the mrayermannmsft-factory-pause-sdk branch September 14, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants