@salesforce/sfdx-agent-harness-claude 0.16.0 → 0.18.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 +15 -0
- package/README.md +41 -80
- package/dist/claude-approval-coordinator.d.ts +51 -16
- package/dist/claude-approval-coordinator.js +92 -38
- package/dist/claude-approval-coordinator.js.map +1 -1
- package/dist/claude-harness-factory.d.ts +9 -3
- package/dist/claude-harness-factory.js +9 -1
- package/dist/claude-harness-factory.js.map +1 -1
- package/dist/claude-harness.d.ts +42 -4
- package/dist/claude-harness.js +129 -15
- package/dist/claude-harness.js.map +1 -1
- package/dist/claude-query-env-builder.d.ts +22 -7
- package/dist/claude-query-env-builder.js +116 -9
- package/dist/claude-query-env-builder.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp-client-factory.d.ts +1 -1
- package/dist/test/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -8
- package/dist/claude-transport-resolver.d.ts +0 -21
- package/dist/claude-transport-resolver.js +0 -6
- package/dist/claude-transport-resolver.js.map +0 -1
- package/dist/direct-claude-transport-resolver.d.ts +0 -13
- package/dist/direct-claude-transport-resolver.js +0 -23
- package/dist/direct-claude-transport-resolver.js.map +0 -1
- package/dist/salesforce-bedrock-transport-resolver.d.ts +0 -104
- package/dist/salesforce-bedrock-transport-resolver.js +0 -74
- package/dist/salesforce-bedrock-transport-resolver.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to `@salesforce/sfdx-agent-harness-claude` are documented in this file.
|
|
4
4
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
|
|
6
|
+
## [0.18.0] - 2026-06-19
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
- **BREAKING** Major refactor to Unify Connectivity via ModelConnectivityInfo @W-22782317 ([#607](https://github.com/forcedotcom/agentic-dx/pull/607))
|
|
10
|
+
|
|
11
|
+
### Chores
|
|
12
|
+
- **deps-dev**: bump @vitest/eslint-plugin from 1.6.19 to 1.6.20 in the vitest group across 1 directory ([#601](https://github.com/forcedotcom/agentic-dx/pull/601))
|
|
13
|
+
- **deps-dev**: bump eslint from 10.4.1 to 10.5.0 in the eslint group across 1 directory ([#600](https://github.com/forcedotcom/agentic-dx/pull/600))
|
|
14
|
+
- **deps-dev**: bump @types/node from 22.19.20 to 22.19.21 in the dev-dependencies group ([#599](https://github.com/forcedotcom/agentic-dx/pull/599))
|
|
15
|
+
|
|
16
|
+
## [0.17.0] - 2026-06-15
|
|
17
|
+
|
|
18
|
+
### Fixes
|
|
19
|
+
- **harness-claude,harness-mastra,agent-sdk**: idempotent settle + quiet dispose (#589) ([#598](https://github.com/forcedotcom/agentic-dx/pull/598))
|
|
20
|
+
|
|
6
21
|
## [0.16.0] - 2026-06-12
|
|
7
22
|
|
|
8
23
|
### Features
|
package/README.md
CHANGED
|
@@ -15,37 +15,39 @@ npm install @salesforce/sfdx-agent-sdk @salesforce/sfdx-agent-harness-claude
|
|
|
15
15
|
## Quick start
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import { createAgentManager } from '@salesforce/sfdx-agent-sdk';
|
|
19
|
-
import { ClaudeHarnessFactory
|
|
18
|
+
import { createAgentManager, DefaultAgentConnectivityResolver } from '@salesforce/sfdx-agent-sdk';
|
|
19
|
+
import { ClaudeHarnessFactory } from '@salesforce/sfdx-agent-harness-claude';
|
|
20
20
|
|
|
21
21
|
const harnessFactory = new ClaudeHarnessFactory({
|
|
22
|
-
resolver: new DirectClaudeTransportResolver(() => process.env.ANTHROPIC_API_KEY!),
|
|
23
22
|
permissionMode: 'bypassPermissions',
|
|
24
23
|
});
|
|
25
24
|
|
|
26
|
-
const manager = await createAgentManager('/path/to/storage', harnessFactory
|
|
25
|
+
const manager = await createAgentManager('/path/to/storage', harnessFactory, {
|
|
26
|
+
connectivityResolver: new DefaultAgentConnectivityResolver(),
|
|
27
|
+
});
|
|
27
28
|
```
|
|
28
29
|
|
|
30
|
+
Connectivity (gateway URL, JWT, headers, native model id) is resolved by an `AgentConnectivityResolver` on the SDK and
|
|
31
|
+
handed to the harness as a `ModelConnectivityInfo` bag. The harness factory itself owns harness-only concerns
|
|
32
|
+
(permission mode, tool-approval timeout, bypass list, query defaults). For BYOK / direct-Anthropic / LLMG-Express
|
|
33
|
+
deployments use `ApiKeyConnectivityResolver`; for non-Salesforce hosts implement your own resolver. See the
|
|
34
|
+
[`@salesforce/sfdx-agent-sdk` README](../sfdx-agent-sdk/README.md) for the full resolver surface.
|
|
35
|
+
|
|
29
36
|
See the [`@salesforce/sfdx-agent-sdk` README](../sfdx-agent-sdk/README.md) for the full consumer-facing API. For
|
|
30
37
|
internal architecture, see [ARCHITECTURE.md](ARCHITECTURE.md).
|
|
31
38
|
|
|
32
39
|
## Public API
|
|
33
40
|
|
|
34
|
-
| Export
|
|
35
|
-
|
|
|
36
|
-
| `ClaudeHarnessFactory`
|
|
37
|
-
| `ClaudeHarnessFactoryConfig`
|
|
38
|
-
| `ClaudeHarnessPermissionMode`
|
|
39
|
-
| `ClaudeAgentHarness`
|
|
40
|
-
| `ClaudeAgentConfig`
|
|
41
|
-
| `ClaudeSkillSearchConfig`
|
|
42
|
-
| `ClaudeToolSearchConfig`
|
|
43
|
-
| `
|
|
44
|
-
| `ClaudeTransportResolverResult` | type | Return type of `ClaudeTransportResolver.resolve()` (`env` + `nativeModelId`). |
|
|
45
|
-
| `ClaudeQueryDefaults` | type | Consumer-overridable defaults for the Claude `query()` call (excludes `model`). |
|
|
46
|
-
| `DirectClaudeTransportResolver` | class | Resolver for direct Anthropic API access (sets `ANTHROPIC_API_KEY`). Suitable for local dev with a personal API key; not the production path. |
|
|
47
|
-
| `SalesforceBedrockClaudeTransportResolver` | class | Resolver that routes the Claude subprocess through the Salesforce LLM Gateway's Bedrock proxy. Canonical production path for Salesforce developer-tooling consumers. |
|
|
48
|
-
| `SalesforceBedrockClaudeTransportResolverConfig` | interface | Configuration for `SalesforceBedrockClaudeTransportResolver` (`gatewayBaseUrl`, optional `modelIdMap`, `appContext`, `featureId`, `ideContext`). |
|
|
41
|
+
| Export | Kind | Description |
|
|
42
|
+
| ----------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `ClaudeHarnessFactory` | class | `HarnessFactory` that produces a Claude-backed `AgentHarness` bound to a storage root. |
|
|
44
|
+
| `ClaudeHarnessFactoryConfig` | interface | Configuration for `ClaudeHarnessFactory` (`permissionMode`, optional `queryDefaults`, `toolApprovalTimeoutMs`, `bypassApprovalTools`). |
|
|
45
|
+
| `ClaudeHarnessPermissionMode` | type | Narrowed permission mode: `'bypassPermissions' \| 'acceptEdits' \| 'plan'`. |
|
|
46
|
+
| `ClaudeAgentHarness` | type | Branded `AgentHarness` subtype carrying the Claude-specific config inference. Inferred at `manager.createAgent` automatically — annotation rarely needed. |
|
|
47
|
+
| `ClaudeAgentConfig` | type | `AgentConfig` extended with Claude-only fields (`skillSearch`, `toolSearch`). |
|
|
48
|
+
| `ClaudeSkillSearchConfig` | type | Shape of `ClaudeAgentConfig.skillSearch` (`topK`). Opts the in-process `skill_bridge` MCP server into search-on-demand mode. |
|
|
49
|
+
| `ClaudeToolSearchConfig` | type | Shape of `ClaudeAgentConfig.toolSearch` (`alwaysActive`). Stamps `_meta['anthropic/alwaysLoad']` on matching tools so they bypass Claude tool-search deferral. |
|
|
50
|
+
| `ClaudeQueryDefaults` | type | Consumer-overridable defaults for the Claude `query()` call (excludes `model`). |
|
|
49
51
|
|
|
50
52
|
### Permission modes
|
|
51
53
|
|
|
@@ -201,65 +203,25 @@ afterwards.
|
|
|
201
203
|
> (which `break` does inside `for await`) finalizes the harness's source generator before the terminal event can reach
|
|
202
204
|
> you. Settle in-line and keep iterating; the loop exits naturally when the terminal `finish` arrives.
|
|
203
205
|
|
|
204
|
-
###
|
|
205
|
-
|
|
206
|
-
The canonical production path for Salesforce developer-tooling consumers. Routes the Claude subprocess through the
|
|
207
|
-
Salesforce LLM Gateway's Bedrock proxy using an org JWT for auth.
|
|
208
|
-
|
|
209
|
-
```ts
|
|
210
|
-
import { createAgentManager } from '@salesforce/sfdx-agent-sdk';
|
|
211
|
-
import { ClaudeHarnessFactory, SalesforceBedrockClaudeTransportResolver } from '@salesforce/sfdx-agent-harness-claude';
|
|
206
|
+
### Connectivity (gateway URL, auth, native model id)
|
|
212
207
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
// No `modelIdMap` needed in the common case: the LLM Gateway's invoke API
|
|
218
|
-
// accepts the gateway-prefixed canonical id (`llmgateway__Bedrock*`) for
|
|
219
|
-
// every Anthropic Claude model, and the SDK's `Model.name` is already that
|
|
220
|
-
// canonical id, so the resolver's default passthrough is correct. Set the
|
|
221
|
-
// map only if your consumer needs to translate to a different shape (e.g.
|
|
222
|
-
// a self-hosted Bedrock proxy that expects the bare-native ids).
|
|
223
|
-
// Optional: override the `x-client-feature-id` header. Defaults to `orgJwt.getFeatureId()`.
|
|
224
|
-
featureId: 'EinsteinGptForDevelopers',
|
|
225
|
-
// Optional: getter for the `x-aip-user-ctx-tag` header. Invoked on every `resolve()`;
|
|
226
|
-
// returning `undefined` (or omitting the option) drops the header. Use when the tag is
|
|
227
|
-
// derived from post-JWT-mint state that changes between turns.
|
|
228
|
-
ideContext: () => orgEntitlement.ideUserContext,
|
|
229
|
-
}),
|
|
230
|
-
permissionMode: 'bypassPermissions',
|
|
231
|
-
});
|
|
208
|
+
The Claude harness reads connectivity per-spawn from a `ModelConnectivityInfo` bag the SDK hands it. The bag carries the
|
|
209
|
+
gateway base URL, the native model id (e.g. `anthropic.claude-sonnet-4-6`), the provider hint (`bedrock-anthropic` or
|
|
210
|
+
`anthropic`), and a `getHeaders()` callback the harness invokes once per subprocess spawn. JWT rotation rides on that
|
|
211
|
+
callback — the next `stream()` call reads the rotated JWT through the same closure without rebuilding anything.
|
|
232
212
|
|
|
233
|
-
|
|
234
|
-
|
|
213
|
+
The SDK ships two bundled resolvers and a documented extension point — see the
|
|
214
|
+
[`@salesforce/sfdx-agent-sdk` README](../sfdx-agent-sdk/README.md):
|
|
235
215
|
|
|
236
|
-
|
|
237
|
-
`
|
|
238
|
-
|
|
239
|
-
|
|
216
|
+
- **`DefaultAgentConnectivityResolver`** — Salesforce-org gateway path. Targets the LLM Gateway's pass-through Bedrock
|
|
217
|
+
endpoint (`/invoke-with-response-stream`) using an org JWT.
|
|
218
|
+
- **`ApiKeyConnectivityResolver`** — direct-Anthropic / OpenAI-direct / LLMG-Express. Constructor takes
|
|
219
|
+
`{ getApiKey, baseUrl, providerHint, ... }`.
|
|
220
|
+
- **Custom `AgentConnectivityResolver`** — for deployments neither bundled resolver covers, implement the SDK's
|
|
221
|
+
`AgentConnectivityResolver` interface and pass it to `createAgentManager({ ..., connectivityResolver })`.
|
|
240
222
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
For deployment topologies neither built-in resolver covers (alternative gateways, custom auth flows, etc.), implement
|
|
244
|
-
the `ClaudeTransportResolver` interface directly.
|
|
245
|
-
|
|
246
|
-
```ts
|
|
247
|
-
import { createAgentManager } from '@salesforce/sfdx-agent-sdk';
|
|
248
|
-
import { ClaudeHarnessFactory } from '@salesforce/sfdx-agent-harness-claude';
|
|
249
|
-
import type { ClaudeTransportResolver } from '@salesforce/sfdx-agent-harness-claude';
|
|
250
|
-
|
|
251
|
-
const resolver: ClaudeTransportResolver = {
|
|
252
|
-
async resolve(orgJwt, modelId) {
|
|
253
|
-
return {
|
|
254
|
-
env: { ANTHROPIC_API_KEY: '...' },
|
|
255
|
-
nativeModelId: 'anthropic.claude-sonnet-4-6',
|
|
256
|
-
};
|
|
257
|
-
},
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
const harnessFactory = new ClaudeHarnessFactory({ resolver, permissionMode: 'bypassPermissions' });
|
|
261
|
-
const manager = await createAgentManager('/path/to/storage', harnessFactory);
|
|
262
|
-
```
|
|
223
|
+
The harness factory itself takes no resolver, gateway URL, or auth field — those concerns live entirely on the
|
|
224
|
+
connectivity resolver.
|
|
263
225
|
|
|
264
226
|
### Per-server MCP reconnect (eager semantics)
|
|
265
227
|
|
|
@@ -287,7 +249,6 @@ reject.
|
|
|
287
249
|
|
|
288
250
|
```ts
|
|
289
251
|
const harnessFactory = new ClaudeHarnessFactory({
|
|
290
|
-
resolver: new DirectClaudeTransportResolver(() => process.env.ANTHROPIC_API_KEY!),
|
|
291
252
|
permissionMode: 'bypassPermissions',
|
|
292
253
|
queryDefaults: {
|
|
293
254
|
maxTurns: 5,
|
|
@@ -307,11 +268,10 @@ across harnesses.
|
|
|
307
268
|
`ClaudeQueryDefaults` does not strip). It blocks the model from emitting `tool_use` for the named built-ins entirely.
|
|
308
269
|
|
|
309
270
|
```ts
|
|
310
|
-
import { createAgentManager } from '@salesforce/sfdx-agent-sdk';
|
|
311
|
-
import { ClaudeHarnessFactory
|
|
271
|
+
import { createAgentManager, DefaultAgentConnectivityResolver } from '@salesforce/sfdx-agent-sdk';
|
|
272
|
+
import { ClaudeHarnessFactory } from '@salesforce/sfdx-agent-harness-claude';
|
|
312
273
|
|
|
313
274
|
const harnessFactory = new ClaudeHarnessFactory({
|
|
314
|
-
resolver: new SalesforceBedrockClaudeTransportResolver({ gatewayBaseUrl: '...' }),
|
|
315
275
|
permissionMode: 'bypassPermissions',
|
|
316
276
|
// Suppress the built-in `AskUserQuestion` so the cross-harness consumer
|
|
317
277
|
// tool below is the only ask-the-user surface the model sees on Claude
|
|
@@ -321,7 +281,9 @@ const harnessFactory = new ClaudeHarnessFactory({
|
|
|
321
281
|
},
|
|
322
282
|
});
|
|
323
283
|
|
|
324
|
-
const manager = await createAgentManager('/path/to/storage', harnessFactory
|
|
284
|
+
const manager = await createAgentManager('/path/to/storage', harnessFactory, {
|
|
285
|
+
connectivityResolver: new DefaultAgentConnectivityResolver(),
|
|
286
|
+
});
|
|
325
287
|
const agent = await manager.createAgent(projectRoot, {
|
|
326
288
|
instructions: '...',
|
|
327
289
|
tools: [
|
|
@@ -360,7 +322,6 @@ additional tool names out of the gate.
|
|
|
360
322
|
|
|
361
323
|
```ts
|
|
362
324
|
const harnessFactory = new ClaudeHarnessFactory({
|
|
363
|
-
resolver: new SalesforceBedrockClaudeTransportResolver({ gatewayBaseUrl: '...' }),
|
|
364
325
|
permissionMode: 'bypassPermissions',
|
|
365
326
|
// Even when `requireToolApproval: true`, calls to these tools bypass the
|
|
366
327
|
// PreToolUse hook. They still emit `tool-call` / `tool-result` ChatEvents,
|
|
@@ -59,10 +59,22 @@ export declare class ClaudeApprovalCoordinator {
|
|
|
59
59
|
/** ToolCallIds the consumer has settled. Rejects double-settle. */
|
|
60
60
|
private readonly consumerSettled;
|
|
61
61
|
/**
|
|
62
|
-
* ToolCallIds the coordinator auto-resolved (timeout / abort / dispose
|
|
63
|
-
* A subsequent settle for these ids
|
|
62
|
+
* ToolCallIds the coordinator auto-resolved (timeout / abort / dispose
|
|
63
|
+
* / pump-error). A subsequent settle for these ids is a silent no-op
|
|
64
|
+
* via the idempotent-settle contract (issue #589) — the lost race is
|
|
65
|
+
* unactionable from the consumer's side, and the methods are
|
|
66
|
+
* void-typed so there's no return value to communicate the no-op.
|
|
64
67
|
*/
|
|
65
68
|
private readonly settledByCoordinator;
|
|
69
|
+
/**
|
|
70
|
+
* ToolCallIds the consumer has settled via {@link submitToolResult},
|
|
71
|
+
* or that the coordinator drained at teardown time. Used as the
|
|
72
|
+
* idempotent-settle ledger for the consumer-tool path (parallel to
|
|
73
|
+
* `consumerSettled` + `settledByCoordinator` on the approve/decline
|
|
74
|
+
* path). A subsequent `submitToolResult` for these ids is a silent
|
|
75
|
+
* no-op rather than throwing `TOOL_CALL_NOT_FOUND` (issue #589).
|
|
76
|
+
*/
|
|
77
|
+
private readonly consumerToolSettled;
|
|
66
78
|
/** Args from the adapter's `tool-call` ChatEvent, keyed by `toolCallId`. */
|
|
67
79
|
private readonly toolCallArgs;
|
|
68
80
|
/**
|
|
@@ -153,21 +165,44 @@ export declare class ClaudeApprovalCoordinator {
|
|
|
153
165
|
/**
|
|
154
166
|
* Single teardown path for abort / dispose / approval-timeout /
|
|
155
167
|
* pump-error. Marks every emitted approval `settledByCoordinator`
|
|
156
|
-
* (so a subsequent `approve` / `decline`
|
|
157
|
-
*
|
|
158
|
-
* Promise and per-id timer, rejects every parked
|
|
159
|
-
* parker, pushes the
|
|
160
|
-
* the subprocess via the injected
|
|
161
|
-
* callbacks.
|
|
168
|
+
* (so a subsequent `approve` / `decline` is a silent no-op via the
|
|
169
|
+
* idempotent-settle path — issue #589), drains every parked
|
|
170
|
+
* `PreToolUse` hook Promise and per-id timer, rejects every parked
|
|
171
|
+
* consumer-tool parker, pushes the typed `error` + `finish('error')`
|
|
172
|
+
* pair on the sink, aborts the subprocess via the injected
|
|
173
|
+
* controller, and fires teardown callbacks.
|
|
174
|
+
*
|
|
175
|
+
* Every teardown reason — including `'dispose'` — pushes both events
|
|
176
|
+
* (issue #589). Two reasons:
|
|
177
|
+
*
|
|
178
|
+
* - **Consumers route on `error.code`, not on the *presence* of an
|
|
179
|
+
* error event.** AFV's `chat-stream-service.ts` maps
|
|
180
|
+
* `error.code === AgentSDKErrorType.DISPOSED` → its internal
|
|
181
|
+
* `AGENT_CANCELLED` and reaps the turn as cancelled (rather than
|
|
182
|
+
* completed or failed). Suppressing the dispose error event would
|
|
183
|
+
* delete that signal: the for-await would exit cleanly without a
|
|
184
|
+
* terminal event, the consumer would see a "completed" turn, and
|
|
185
|
+
* a turn that was actually torn down by a superseding `chat()` /
|
|
186
|
+
* `destroyThread` / `destroyAgent` / `shutdown` would record as
|
|
187
|
+
* successful in their telemetry pipeline. The original bug
|
|
188
|
+
* (issue #589 failure 2) was *untyped* error noise — `error.code`
|
|
189
|
+
* is already typed as `AgentSDKErrorType.DISPOSED`, which gives
|
|
190
|
+
* consumers a clean discriminator without string-matching.
|
|
191
|
+
*
|
|
192
|
+
* - **The SDK invariant requires every chat turn to end with one
|
|
193
|
+
* terminal `FinishEvent`.** `DefaultChatSession.wrapEventStream`
|
|
194
|
+
* only synthesizes a synthetic `finish` when an error landed on
|
|
195
|
+
* the stream; if dispose ended the sink without an error, there'd
|
|
196
|
+
* be no synthesis path and the turn would end with neither a
|
|
197
|
+
* natural finish nor a synthetic one — breaking the SDK contract
|
|
198
|
+
* pinned in `packages/sfdx-agent-sdk/ARCHITECTURE.md` →
|
|
199
|
+
* "Critical Invariants" → "Every chat turn ends with exactly one
|
|
200
|
+
* terminal FinishEvent".
|
|
162
201
|
*
|
|
163
|
-
* The `reason` parameter changes
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* - `'timeout'` resolves every parked hook with `decision: 'block'`
|
|
168
|
-
* so the agentic loop ends politely; the other reasons reject
|
|
169
|
-
* parked hooks with the underlying error so the SDK surfaces
|
|
170
|
-
* each as a tool failure.
|
|
202
|
+
* The `reason` parameter changes one thing: `'timeout'` resolves
|
|
203
|
+
* every parked hook with `decision: 'block'` so the agentic loop
|
|
204
|
+
* ends politely; the other reasons reject parked hooks with the
|
|
205
|
+
* underlying error so the SDK surfaces each as a tool failure.
|
|
171
206
|
*
|
|
172
207
|
* Mirrors the Mastra coordinator's `teardown` so the pump-throw /
|
|
173
208
|
* abort / dispose / timeout paths can't drift out of step on either
|
|
@@ -53,10 +53,22 @@ export class ClaudeApprovalCoordinator {
|
|
|
53
53
|
/** ToolCallIds the consumer has settled. Rejects double-settle. */
|
|
54
54
|
consumerSettled = new Set();
|
|
55
55
|
/**
|
|
56
|
-
* ToolCallIds the coordinator auto-resolved (timeout / abort / dispose
|
|
57
|
-
* A subsequent settle for these ids
|
|
56
|
+
* ToolCallIds the coordinator auto-resolved (timeout / abort / dispose
|
|
57
|
+
* / pump-error). A subsequent settle for these ids is a silent no-op
|
|
58
|
+
* via the idempotent-settle contract (issue #589) — the lost race is
|
|
59
|
+
* unactionable from the consumer's side, and the methods are
|
|
60
|
+
* void-typed so there's no return value to communicate the no-op.
|
|
58
61
|
*/
|
|
59
62
|
settledByCoordinator = new Set();
|
|
63
|
+
/**
|
|
64
|
+
* ToolCallIds the consumer has settled via {@link submitToolResult},
|
|
65
|
+
* or that the coordinator drained at teardown time. Used as the
|
|
66
|
+
* idempotent-settle ledger for the consumer-tool path (parallel to
|
|
67
|
+
* `consumerSettled` + `settledByCoordinator` on the approve/decline
|
|
68
|
+
* path). A subsequent `submitToolResult` for these ids is a silent
|
|
69
|
+
* no-op rather than throwing `TOOL_CALL_NOT_FOUND` (issue #589).
|
|
70
|
+
*/
|
|
71
|
+
consumerToolSettled = new Set();
|
|
60
72
|
/** Args from the adapter's `tool-call` ChatEvent, keyed by `toolCallId`. */
|
|
61
73
|
toolCallArgs = new Map();
|
|
62
74
|
/**
|
|
@@ -199,21 +211,44 @@ export class ClaudeApprovalCoordinator {
|
|
|
199
211
|
/**
|
|
200
212
|
* Single teardown path for abort / dispose / approval-timeout /
|
|
201
213
|
* pump-error. Marks every emitted approval `settledByCoordinator`
|
|
202
|
-
* (so a subsequent `approve` / `decline`
|
|
203
|
-
*
|
|
204
|
-
* Promise and per-id timer, rejects every parked
|
|
205
|
-
* parker, pushes the
|
|
206
|
-
* the subprocess via the injected
|
|
207
|
-
* callbacks.
|
|
214
|
+
* (so a subsequent `approve` / `decline` is a silent no-op via the
|
|
215
|
+
* idempotent-settle path — issue #589), drains every parked
|
|
216
|
+
* `PreToolUse` hook Promise and per-id timer, rejects every parked
|
|
217
|
+
* consumer-tool parker, pushes the typed `error` + `finish('error')`
|
|
218
|
+
* pair on the sink, aborts the subprocess via the injected
|
|
219
|
+
* controller, and fires teardown callbacks.
|
|
220
|
+
*
|
|
221
|
+
* Every teardown reason — including `'dispose'` — pushes both events
|
|
222
|
+
* (issue #589). Two reasons:
|
|
223
|
+
*
|
|
224
|
+
* - **Consumers route on `error.code`, not on the *presence* of an
|
|
225
|
+
* error event.** AFV's `chat-stream-service.ts` maps
|
|
226
|
+
* `error.code === AgentSDKErrorType.DISPOSED` → its internal
|
|
227
|
+
* `AGENT_CANCELLED` and reaps the turn as cancelled (rather than
|
|
228
|
+
* completed or failed). Suppressing the dispose error event would
|
|
229
|
+
* delete that signal: the for-await would exit cleanly without a
|
|
230
|
+
* terminal event, the consumer would see a "completed" turn, and
|
|
231
|
+
* a turn that was actually torn down by a superseding `chat()` /
|
|
232
|
+
* `destroyThread` / `destroyAgent` / `shutdown` would record as
|
|
233
|
+
* successful in their telemetry pipeline. The original bug
|
|
234
|
+
* (issue #589 failure 2) was *untyped* error noise — `error.code`
|
|
235
|
+
* is already typed as `AgentSDKErrorType.DISPOSED`, which gives
|
|
236
|
+
* consumers a clean discriminator without string-matching.
|
|
208
237
|
*
|
|
209
|
-
* The
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
238
|
+
* - **The SDK invariant requires every chat turn to end with one
|
|
239
|
+
* terminal `FinishEvent`.** `DefaultChatSession.wrapEventStream`
|
|
240
|
+
* only synthesizes a synthetic `finish` when an error landed on
|
|
241
|
+
* the stream; if dispose ended the sink without an error, there'd
|
|
242
|
+
* be no synthesis path and the turn would end with neither a
|
|
243
|
+
* natural finish nor a synthetic one — breaking the SDK contract
|
|
244
|
+
* pinned in `packages/sfdx-agent-sdk/ARCHITECTURE.md` →
|
|
245
|
+
* "Critical Invariants" → "Every chat turn ends with exactly one
|
|
246
|
+
* terminal FinishEvent".
|
|
247
|
+
*
|
|
248
|
+
* The `reason` parameter changes one thing: `'timeout'` resolves
|
|
249
|
+
* every parked hook with `decision: 'block'` so the agentic loop
|
|
250
|
+
* ends politely; the other reasons reject parked hooks with the
|
|
251
|
+
* underlying error so the SDK surfaces each as a tool failure.
|
|
217
252
|
*
|
|
218
253
|
* Mirrors the Mastra coordinator's `teardown` so the pump-throw /
|
|
219
254
|
* abort / dispose / timeout paths can't drift out of step on either
|
|
@@ -226,6 +261,10 @@ export class ClaudeApprovalCoordinator {
|
|
|
226
261
|
this.tornDown = true;
|
|
227
262
|
for (const id of this.emittedApprovals)
|
|
228
263
|
this.settledByCoordinator.add(id);
|
|
264
|
+
for (const id of this.pendingByToolCallId.keys())
|
|
265
|
+
this.consumerToolSettled.add(id);
|
|
266
|
+
for (const id of this.recentToolCallNameById.keys())
|
|
267
|
+
this.consumerToolSettled.add(id);
|
|
229
268
|
if (reason === 'timeout') {
|
|
230
269
|
// Resolve every parked PreToolUse hook with the SDK's
|
|
231
270
|
// polite-halt shape so the agentic loop ends without
|
|
@@ -255,15 +294,9 @@ export class ClaudeApprovalCoordinator {
|
|
|
255
294
|
// Reject every parked consumer-tool call so the bridge handler
|
|
256
295
|
// unblocks with an error rather than waiting forever.
|
|
257
296
|
this.failAllPendingConsumerCalls(error);
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
this.initial.push({ type: 'error', error, code });
|
|
264
|
-
this.initial.push({ type: 'finish', finishReason: 'error' });
|
|
265
|
-
this.initial.end();
|
|
266
|
-
}
|
|
297
|
+
this.initial.push({ type: 'error', error, code });
|
|
298
|
+
this.initial.push({ type: 'finish', finishReason: 'error' });
|
|
299
|
+
this.initial.end();
|
|
267
300
|
// Kill the subprocess on every teardown reason. `abort` is
|
|
268
301
|
// already aborted by the harness's abort listener forwarding
|
|
269
302
|
// (which calls `controller.abort()` before `coordinator.abort()`);
|
|
@@ -359,15 +392,22 @@ export class ClaudeApprovalCoordinator {
|
|
|
359
392
|
}));
|
|
360
393
|
}
|
|
361
394
|
settlePending(method, toolCallId, decide) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
395
|
+
// Issue #589: idempotent settle. A tool call the coordinator
|
|
396
|
+
// already auto-resolved (timeout / abort / dispose / pump-error) or
|
|
397
|
+
// the consumer already settled is a lost-race no-op rather than a
|
|
398
|
+
// throw — settle methods are void-typed, so the consumer never
|
|
399
|
+
// branches on a return value, and the outcome they wanted (id is
|
|
400
|
+
// settled) is already true.
|
|
401
|
+
if (this.settledByCoordinator.has(toolCallId) || this.consumerSettled.has(toolCallId)) {
|
|
402
|
+
return;
|
|
367
403
|
}
|
|
368
404
|
const pending = this.pendingApprovals.get(toolCallId);
|
|
369
405
|
if (!pending && !this.emittedApprovals.has(toolCallId)) {
|
|
370
|
-
|
|
406
|
+
// Genuine misuse — the coordinator never saw this id (typo,
|
|
407
|
+
// wrong session, or settle called before approval-request /
|
|
408
|
+
// tool-call ever fired). Typed so consumers can branch on
|
|
409
|
+
// err.type instead of string-matching the message.
|
|
410
|
+
throw new AgentSDKError(`ClaudeApprovalCoordinator.${method}(): no pending approval for tool call "${toolCallId}"`, AgentSDKErrorType.TOOL_CALL_NOT_FOUND);
|
|
371
411
|
}
|
|
372
412
|
this.consumerSettled.add(toolCallId);
|
|
373
413
|
const input = pending?.input ?? this.toolCallArgs.get(toolCallId) ?? {};
|
|
@@ -437,8 +477,18 @@ export class ClaudeApprovalCoordinator {
|
|
|
437
477
|
* consumer is iterating from `chat()`.
|
|
438
478
|
*/
|
|
439
479
|
submitToolResult(toolCallId, result, isError) {
|
|
480
|
+
// Issue #589: idempotent settle. A submitToolResult for an id the
|
|
481
|
+
// consumer already settled, or that the coordinator drained at
|
|
482
|
+
// teardown time, is a silent no-op — the lost-race shape is
|
|
483
|
+
// unactionable from the consumer's side, and the method is
|
|
484
|
+
// void-typed. Mirrors the approve/decline path's
|
|
485
|
+
// `consumerSettled` + `settledByCoordinator` ledger.
|
|
486
|
+
if (this.consumerToolSettled.has(toolCallId)) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
440
489
|
const entry = this.pendingByToolCallId.get(toolCallId);
|
|
441
490
|
if (entry) {
|
|
491
|
+
this.consumerToolSettled.add(toolCallId);
|
|
442
492
|
this.pendingByToolCallId.delete(toolCallId);
|
|
443
493
|
entry.resolve({ result, isError });
|
|
444
494
|
return;
|
|
@@ -447,10 +497,14 @@ export class ClaudeApprovalCoordinator {
|
|
|
447
497
|
// toolCallId) but the bridge handler hasn't parked yet. Stage the
|
|
448
498
|
// result; the parker resolves as soon as it arrives.
|
|
449
499
|
if (this.recentToolCallNameById.has(toolCallId)) {
|
|
500
|
+
this.consumerToolSettled.add(toolCallId);
|
|
450
501
|
this.preSubmittedByToolCallId.set(toolCallId, { result, isError });
|
|
451
502
|
return;
|
|
452
503
|
}
|
|
453
|
-
|
|
504
|
+
// Issue #589: typed error — the coordinator never saw this id, so
|
|
505
|
+
// this is genuine misuse rather than the lost-race shape the
|
|
506
|
+
// idempotent-settle path collapses to a no-op.
|
|
507
|
+
throw new AgentSDKError(`ClaudeApprovalCoordinator.submitToolResult(): no pending tool call for id "${toolCallId}"`, AgentSDKErrorType.TOOL_CALL_NOT_FOUND);
|
|
454
508
|
}
|
|
455
509
|
failAllPendingConsumerCalls(err) {
|
|
456
510
|
for (const list of this.waitingParkersByName.values()) {
|
|
@@ -481,12 +535,12 @@ export class ClaudeApprovalCoordinator {
|
|
|
481
535
|
// so every parked PreToolUse hook is rejected, every
|
|
482
536
|
// consumer-tool parker is failed, every emitted approval is
|
|
483
537
|
// marked `settledByCoordinator` (so a subsequent
|
|
484
|
-
// `approve(tc-N)`
|
|
485
|
-
// instead of deadlocking on a sink the
|
|
486
|
-
// and the synthetic terminal pair lands
|
|
487
|
-
// sink the consumer is iterating.
|
|
488
|
-
// `pumpUntilSuspendOrTerminal` catch block —
|
|
489
|
-
// audit's Claude Finding #1 / Mastra Finding #1.
|
|
538
|
+
// `approve(tc-N)` is a silent no-op via the idempotent-settle
|
|
539
|
+
// path — issue #589 — instead of deadlocking on a sink the
|
|
540
|
+
// pump just torched), and the synthetic terminal pair lands
|
|
541
|
+
// on the same `initial` sink the consumer is iterating.
|
|
542
|
+
// Mirrors Mastra's `pumpUntilSuspendOrTerminal` catch block —
|
|
543
|
+
// closes the audit's Claude Finding #1 / Mastra Finding #1.
|
|
490
544
|
//
|
|
491
545
|
// Re-entry from a prior abort/dispose/timeout teardown that
|
|
492
546
|
// aborted the subprocess (which then surfaces here as the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-approval-coordinator.js","sourceRoot":"","sources":["../src/claude-approval-coordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,aAAa,EACb,iBAAiB,GAKpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,MAAM,UAAU,GAAG,OAAO,CAAC;AA0D3B,MAAM,OAAO,yBAAyB;IACjB,OAAO,CAAqB;IAC5B,qBAAqB,CAAS;IAC9B,eAAe,CAAkB;IACjC,qBAAqB,CAAyB;IAC9C,IAAI,CAAqB;IACzB,wBAAwB,CAAqB;IAE9D,sEAAsE;IACrD,OAAO,GAAuB,IAAI,OAAO,EAAa,CAAC;IAExE,gEAAgE;IAC/C,gBAAgB,GAAG,IAAI,GAAG,EAA2B,CAAC;IAEvE,0DAA0D;IACzC,SAAS,GAAG,IAAI,GAAG,EAA0B,CAAC;IAE/D,wEAAwE;IACvD,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;IAEtD,mEAAmE;IAClD,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAErD;;;OAGG;IACc,oBAAoB,GAAG,IAAI,GAAG,EAAU,CAAC;IAE1D,4EAA4E;IAC3D,YAAY,GAAG,IAAI,GAAG,EAAmC,CAAC;IAE3E;;;;;;;;;;;;;;OAcG;IACK,oBAAoB,GAAkB,IAAI,CAAC;IAEnD;;;;;;OAMG;IACc,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE/D;;;;;OAKG;IACc,qBAAqB,GAAG,IAAI,GAAG,EAAoB,CAAC;IAErE,2FA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IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAClD,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;OAYG;IACK,cAAc,CAAC,UAAkB,EAAE,gBAAwB;QAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAChE,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC;QAC/B,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAChD,OAAO;QACX,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC/D,IAAI,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;;YAC7B,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAClE,CAAC;CACJ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { HarnessFactory } from '@salesforce/sfdx-agent-sdk';
|
|
2
|
-
import type { ClaudeTransportResolver } from './claude-transport-resolver.js';
|
|
1
|
+
import type { HarnessFactory, ProviderHint } from '@salesforce/sfdx-agent-sdk';
|
|
3
2
|
import type { ClaudeQueryDefaults } from './claude-query-options-builder.js';
|
|
4
3
|
import { type ClaudeAgentHarness } from './claude-harness.js';
|
|
5
4
|
/**
|
|
@@ -13,7 +12,6 @@ import { type ClaudeAgentHarness } from './claude-harness.js';
|
|
|
13
12
|
*/
|
|
14
13
|
export type ClaudeHarnessPermissionMode = 'bypassPermissions' | 'acceptEdits' | 'plan';
|
|
15
14
|
export interface ClaudeHarnessFactoryConfig {
|
|
16
|
-
resolver: ClaudeTransportResolver;
|
|
17
15
|
permissionMode: ClaudeHarnessPermissionMode;
|
|
18
16
|
queryDefaults?: ClaudeQueryDefaults;
|
|
19
17
|
/**
|
|
@@ -42,6 +40,14 @@ export declare class ClaudeHarnessFactory implements HarnessFactory<ClaudeAgentH
|
|
|
42
40
|
private readonly config;
|
|
43
41
|
readonly harnessId = "claude";
|
|
44
42
|
readonly protocolVersion = 1;
|
|
43
|
+
/**
|
|
44
|
+
* The Claude CLI binary speaks Anthropic-shaped protocols only — both the
|
|
45
|
+
* Bedrock pass-through (`'bedrock-anthropic'`) and direct Anthropic API
|
|
46
|
+
* (`'anthropic'`). Routing it at a non-Anthropic model is a programming
|
|
47
|
+
* error caught at `createAgent` / `updateAgentConfig` by the manager's
|
|
48
|
+
* G8 validation.
|
|
49
|
+
*/
|
|
50
|
+
readonly supportedProviderHints: readonly ProviderHint[];
|
|
45
51
|
constructor(config: ClaudeHarnessFactoryConfig);
|
|
46
52
|
create(storageRootFolder: string): Promise<ClaudeAgentHarness>;
|
|
47
53
|
}
|
|
@@ -10,11 +10,19 @@ export class ClaudeHarnessFactory {
|
|
|
10
10
|
config;
|
|
11
11
|
harnessId = 'claude';
|
|
12
12
|
protocolVersion = 1;
|
|
13
|
+
/**
|
|
14
|
+
* The Claude CLI binary speaks Anthropic-shaped protocols only — both the
|
|
15
|
+
* Bedrock pass-through (`'bedrock-anthropic'`) and direct Anthropic API
|
|
16
|
+
* (`'anthropic'`). Routing it at a non-Anthropic model is a programming
|
|
17
|
+
* error caught at `createAgent` / `updateAgentConfig` by the manager's
|
|
18
|
+
* G8 validation.
|
|
19
|
+
*/
|
|
20
|
+
supportedProviderHints = ['anthropic', 'bedrock-anthropic'];
|
|
13
21
|
constructor(config) {
|
|
14
22
|
this.config = config;
|
|
15
23
|
}
|
|
16
24
|
async create(storageRootFolder) {
|
|
17
|
-
const envBuilder = new ClaudeQueryEnvBuilder(
|
|
25
|
+
const envBuilder = new ClaudeQueryEnvBuilder(storageRootFolder);
|
|
18
26
|
const permissionDefaults = {
|
|
19
27
|
permissionMode: this.config.permissionMode,
|
|
20
28
|
...(this.config.permissionMode === 'bypassPermissions'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-harness-factory.js","sourceRoot":"","sources":["../src/claude-harness-factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"claude-harness-factory.js","sourceRoot":"","sources":["../src/claude-harness-factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAA2B,MAAM,qBAAqB,CAAC;AAa7E,MAAM,gCAAgC,GAAG,OAAO,CAAC;AA4BjD,MAAM,OAAO,oBAAoB;IAYA;IAXpB,SAAS,GAAG,QAAQ,CAAC;IACrB,eAAe,GAAG,CAAC,CAAC;IAC7B;;;;;;OAMG;IACM,sBAAsB,GAA4B,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;IAE9F,YAA6B,MAAkC;QAAlC,WAAM,GAAN,MAAM,CAA4B;IAAG,CAAC;IAEnE,KAAK,CAAC,MAAM,CAAC,iBAAyB;QAClC,MAAM,UAAU,GAAG,IAAI,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;QAChE,MAAM,kBAAkB,GAAG;YACvB,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc;YAC1C,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,KAAK,mBAAmB;gBAClD,CAAC,CAAC,EAAE,+BAA+B,EAAE,IAAa,EAAE;gBACpD,CAAC,CAAC,EAAE,CAAC;SACZ,CAAC;QACF,iEAAiE;QACjE,iEAAiE;QACjE,iEAAiE;QACjE,0DAA0D;QAC1D,kBAA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