@salesforce/sfdx-agent-harness-mastra 0.60.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
All notable changes to `@salesforce/sfdx-agent-harness-mastra` are documented in this file.
|
|
4
4
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
|
|
6
|
+
## [0.61.0] - 2026-09-01
|
|
7
|
+
|
|
8
|
+
### Fixes
|
|
9
|
+
- **harness-mastra**: forward abortSignal into provider gateway fetch @W-23988781@ ([#779](https://github.com/forcedotcom/agentic-dx/pull/779))
|
|
10
|
+
|
|
6
11
|
## [0.60.0] - 2026-09-01
|
|
7
12
|
|
|
8
13
|
### Features
|
|
@@ -170,7 +170,10 @@ async function buildAnthropicRequest(ctx, options) {
|
|
|
170
170
|
}
|
|
171
171
|
async function doGenerate(ctx, options) {
|
|
172
172
|
const { client, commonParams } = await buildAnthropicRequest(ctx, options);
|
|
173
|
-
|
|
173
|
+
// Forward the turn's AbortSignal into the SDK's RequestOptions so firing the
|
|
174
|
+
// controller (POST /cancel, idle timeout, shutdown abortAll) actually aborts
|
|
175
|
+
// the outbound gateway fetch, not just harness bookkeeping (W-23988781).
|
|
176
|
+
const message = await client.messages.create({ ...commonParams, stream: false }, { signal: options.abortSignal });
|
|
174
177
|
const content = [];
|
|
175
178
|
let sawToolCalls = false;
|
|
176
179
|
for (const block of message.content) {
|
|
@@ -201,7 +204,9 @@ async function doGenerate(ctx, options) {
|
|
|
201
204
|
}
|
|
202
205
|
async function doStream(ctx, options) {
|
|
203
206
|
const { client, commonParams } = await buildAnthropicRequest(ctx, options);
|
|
204
|
-
|
|
207
|
+
// See doGenerate: thread the AbortSignal into the SDK so a mid-stream abort
|
|
208
|
+
// tears down the live gateway socket (W-23988781).
|
|
209
|
+
const sdkStream = await client.messages.create({ ...commonParams, stream: true }, { signal: options.abortSignal });
|
|
205
210
|
const stream = new ReadableStream({
|
|
206
211
|
start: async (controller) => {
|
|
207
212
|
const textSpan = new TextSpanLifecycle();
|
|
@@ -78,7 +78,10 @@ async function buildRequest(ctx, options) {
|
|
|
78
78
|
async function doGenerate(ctx, options) {
|
|
79
79
|
const { client, commonParams } = await buildRequest(ctx, options);
|
|
80
80
|
const params = { ...commonParams };
|
|
81
|
-
|
|
81
|
+
// Forward the turn's AbortSignal into the SDK's RequestOptions so firing the
|
|
82
|
+
// controller (POST /cancel, idle timeout, shutdown abortAll) actually aborts
|
|
83
|
+
// the outbound gateway fetch, not just harness bookkeeping (W-23988781).
|
|
84
|
+
const response = await client.chat.completions.create(params, { signal: options.abortSignal });
|
|
82
85
|
const content = [];
|
|
83
86
|
const choice = response.choices[0];
|
|
84
87
|
let sawToolCalls = false;
|
|
@@ -120,7 +123,9 @@ async function doStream(ctx, options) {
|
|
|
120
123
|
// to `undefined` `LanguageModelV3Usage` per the missing-usage contract.
|
|
121
124
|
stream_options: { include_usage: true },
|
|
122
125
|
};
|
|
123
|
-
|
|
126
|
+
// See doGenerate: thread the AbortSignal into the SDK so a mid-stream abort
|
|
127
|
+
// tears down the live gateway socket (W-23988781).
|
|
128
|
+
const sdkStream = await client.chat.completions.create(params, { signal: options.abortSignal });
|
|
124
129
|
const stream = new ReadableStream({
|
|
125
130
|
start: async (controller) => {
|
|
126
131
|
const textSpan = new TextSpanLifecycle();
|
|
@@ -76,7 +76,10 @@ async function buildOpenAIRequest(ctx, options) {
|
|
|
76
76
|
async function doGenerate(ctx, options) {
|
|
77
77
|
const { client, commonParams } = await buildOpenAIRequest(ctx, options);
|
|
78
78
|
const params = { ...commonParams };
|
|
79
|
-
|
|
79
|
+
// Forward the turn's AbortSignal into the SDK's RequestOptions so firing the
|
|
80
|
+
// controller (POST /cancel, idle timeout, shutdown abortAll) actually aborts
|
|
81
|
+
// the outbound gateway fetch, not just harness bookkeeping (W-23988781).
|
|
82
|
+
const response = await client.responses.create(params, { signal: options.abortSignal });
|
|
80
83
|
const content = [];
|
|
81
84
|
let sawToolCalls = false;
|
|
82
85
|
if (response.output_text && response.output_text.length > 0) {
|
|
@@ -103,7 +106,9 @@ async function doGenerate(ctx, options) {
|
|
|
103
106
|
async function doStream(ctx, options) {
|
|
104
107
|
const { client, commonParams } = await buildOpenAIRequest(ctx, options);
|
|
105
108
|
const params = { ...commonParams, stream: true };
|
|
106
|
-
|
|
109
|
+
// See doGenerate: thread the AbortSignal into the SDK so a mid-stream abort
|
|
110
|
+
// tears down the live gateway socket (W-23988781).
|
|
111
|
+
const sdkStream = await client.responses.create(params, { signal: options.abortSignal });
|
|
107
112
|
const stream = new ReadableStream({
|
|
108
113
|
start: async (controller) => {
|
|
109
114
|
const textSpan = new TextSpanLifecycle();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/sfdx-agent-harness-mastra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"description": "Mastra-backed AgentHarness implementation for @salesforce/sfdx-agent-sdk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"openai": "^7.0.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@salesforce/sfdx-agent-sdk": "0.
|
|
45
|
+
"@salesforce/sfdx-agent-sdk": "0.62.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@eslint/js": "^10.0.1",
|
|
49
49
|
"@salesforce/harness-conformance": "0.0.1",
|
|
50
|
-
"@salesforce/sfdx-agent-sdk": "0.
|
|
50
|
+
"@salesforce/sfdx-agent-sdk": "0.62.0",
|
|
51
51
|
"@types/node": "^22.20.1",
|
|
52
52
|
"@vitest/coverage-istanbul": "^4.1.10",
|
|
53
53
|
"@vitest/eslint-plugin": "^1.6.27",
|