@slopus/happy-providers 0.0.61 → 0.0.63
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/README.md +4 -2
- package/VENDOR_ANTHROPIC_BEDROCK.md +66 -0
- package/VENDOR_CLAUDE.md +17 -0
- package/VENDOR_CODEX.md +6 -0
- package/dist/core/SessionEvent.d.ts +7 -1
- package/dist/core/SessionEvent.d.ts.map +1 -1
- package/dist/core/SessionEvent.js.map +1 -1
- package/dist/core/happyProvidersVersion.d.ts +1 -1
- package/dist/core/happyProvidersVersion.js +1 -1
- package/dist/protocol/anthropic/createAnthropicRequest.d.ts +8 -0
- package/dist/protocol/anthropic/createAnthropicRequest.d.ts.map +1 -1
- package/dist/protocol/anthropic/createAnthropicRequest.js +14 -1
- package/dist/protocol/anthropic/createAnthropicRequest.js.map +1 -1
- package/dist/vendors/bedrock/AnthropicBedrockSession.d.ts +26 -0
- package/dist/vendors/bedrock/AnthropicBedrockSession.d.ts.map +1 -1
- package/dist/vendors/bedrock/AnthropicBedrockSession.js +117 -14
- package/dist/vendors/bedrock/AnthropicBedrockSession.js.map +1 -1
- package/dist/vendors/bedrock/impl/anthropicBedrockThinkingBinding.d.ts +27 -0
- package/dist/vendors/bedrock/impl/anthropicBedrockThinkingBinding.d.ts.map +1 -0
- package/dist/vendors/bedrock/impl/anthropicBedrockThinkingBinding.js +54 -0
- package/dist/vendors/bedrock/impl/anthropicBedrockThinkingBinding.js.map +1 -0
- package/dist/vendors/bedrock/impl/anthropicBedrockThinkingHeal.d.ts +35 -0
- package/dist/vendors/bedrock/impl/anthropicBedrockThinkingHeal.d.ts.map +1 -0
- package/dist/vendors/bedrock/impl/anthropicBedrockThinkingHeal.js +133 -0
- package/dist/vendors/bedrock/impl/anthropicBedrockThinkingHeal.js.map +1 -0
- package/dist/vendors/bedrock/impl/resolveBedrockModelId.d.ts.map +1 -1
- package/dist/vendors/bedrock/impl/resolveBedrockModelId.js +2 -0
- package/dist/vendors/bedrock/impl/resolveBedrockModelId.js.map +1 -1
- package/dist/vendors/claude/ClaudeSession.d.ts.map +1 -1
- package/dist/vendors/claude/ClaudeSession.js +13 -1
- package/dist/vendors/claude/ClaudeSession.js.map +1 -1
- package/dist/vendors/claude/errors/claudeErrors.d.ts +8 -1
- package/dist/vendors/claude/errors/claudeErrors.d.ts.map +1 -1
- package/dist/vendors/claude/errors/claudeErrors.js +27 -0
- package/dist/vendors/claude/errors/claudeErrors.js.map +1 -1
- package/dist/vendors/claude/impl/spawnClaudeCodeChild.d.ts +27 -0
- package/dist/vendors/claude/impl/spawnClaudeCodeChild.d.ts.map +1 -0
- package/dist/vendors/claude/impl/spawnClaudeCodeChild.js +158 -0
- package/dist/vendors/claude/impl/spawnClaudeCodeChild.js.map +1 -0
- package/dist/vendors/claude/impl/toClaudeRetryEvent.d.ts.map +1 -1
- package/dist/vendors/claude/impl/toClaudeRetryEvent.js +2 -0
- package/dist/vendors/claude/impl/toClaudeRetryEvent.js.map +1 -1
- package/dist/vendors/claude/impl/toClaudeSdkOptions.d.ts.map +1 -1
- package/dist/vendors/claude/impl/toClaudeSdkOptions.js +11 -0
- package/dist/vendors/claude/impl/toClaudeSdkOptions.js.map +1 -1
- package/dist/vendors/claudeAgent/claudeAgentConnect.d.ts.map +1 -1
- package/dist/vendors/claudeAgent/claudeAgentConnect.js +10 -13
- package/dist/vendors/claudeAgent/claudeAgentConnect.js.map +1 -1
- package/dist/vendors/codex/CodexProvider.js +1 -1
- package/dist/vendors/codex/CodexProvider.js.map +1 -1
- package/dist/vendors/codex/impl/getCodexModelProperties.d.ts.map +1 -1
- package/dist/vendors/codex/impl/getCodexModelProperties.js +15 -0
- package/dist/vendors/codex/impl/getCodexModelProperties.js.map +1 -1
- package/dist/vendors/codexAppServer/codexAppServerConnect.js +31 -0
- package/dist/vendors/codexAppServer/codexAppServerConnect.js.map +1 -1
- package/dist/vendors/foreignAgents/codexCliAgent.d.ts.map +1 -1
- package/dist/vendors/foreignAgents/codexCliAgent.js +2 -0
- package/dist/vendors/foreignAgents/codexCliAgent.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -546,7 +546,9 @@ block_start -> replacement deltas -> block_stop -> done
|
|
|
546
546
|
|
|
547
547
|
- `block_start` begins tentative output for an attempt.
|
|
548
548
|
- `block_reset` retracts everything since the matching `block_start`.
|
|
549
|
-
- `retrying` reports the next provider-owned retry and its reason.
|
|
549
|
+
- `retrying` reports the next provider-owned retry and its reason. When the provider knows what
|
|
550
|
+
failed, `providerError` classifies it in the same vocabulary as a terminal error, so a UI can
|
|
551
|
+
say "signing in again" rather than "overloaded" while the provider retries.
|
|
550
552
|
- `block_stop` commits the current block; its output is now safe to persist as the response.
|
|
551
553
|
|
|
552
554
|
`block_reset` may also precede cancellation or a terminal error when no retry follows. It rewinds
|
|
@@ -1027,7 +1029,7 @@ type SessionEvent =
|
|
|
1027
1029
|
incomplete?: boolean;
|
|
1028
1030
|
}
|
|
1029
1031
|
// Progress.
|
|
1030
|
-
| { type: "retrying"; attempt: number; reason: string }
|
|
1032
|
+
| { type: "retrying"; attempt: number; reason: string; providerError?: SessionProviderError }
|
|
1031
1033
|
| { type: "token_usage"; usage: SessionUsage }
|
|
1032
1034
|
// Exactly one done event ends every started stream.
|
|
1033
1035
|
| { type: "done"; state: "cancelled" }
|
|
@@ -26,6 +26,68 @@ disabled. The replay edit's trigger sits beyond the 1M context window so the pro
|
|
|
26
26
|
compacts mid-run; only `compact()` sends the edit with a real trigger and
|
|
27
27
|
`pause_after_compaction` to ask the provider for a new checkpoint.
|
|
28
28
|
|
|
29
|
+
On Runtime, a request for a model that checks the prefix of replayed thinking (Fable 5.2,
|
|
30
|
+
Mythos 5.2, Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5) additionally carries the
|
|
31
|
+
`thinking-binding-controls-2026-08-01` beta and
|
|
32
|
+
`thinking: { type: "adaptive", block_binding: { prefix_mismatch_behavior: "drop_block" } }`.
|
|
33
|
+
These models tie each signed thinking block to the system prompt, the tools, and every message
|
|
34
|
+
before it. When any of them changed, the API otherwise rejects the request with `Invalid signature
|
|
35
|
+
in thinking block. The block is bound to a different conversation`, and the conversation cannot
|
|
36
|
+
recover, because the caller's stored history still holds that thinking. A caller's system prompt
|
|
37
|
+
and tools do change during a conversation, so the adapter asks the API to drop the blocks that
|
|
38
|
+
fail the check, and every later thinking block, for that request. The history is sent byte for
|
|
39
|
+
byte and stays the caller's; the drop is the server's own projection. It costs the prompt cache
|
|
40
|
+
from the first dropped block onward and the model its earlier reasoning, so a caller should still
|
|
41
|
+
keep its prefix stable. Inference and compaction both carry the control. It is left out with
|
|
42
|
+
thinking disabled, where the API refuses the field, for every other model, for a model named only
|
|
43
|
+
by an opaque ARN, and on Mantle.
|
|
44
|
+
|
|
45
|
+
The control follows the AWS Bedrock user guide's "Preserved thinking" page, which documents it for
|
|
46
|
+
`InvokeModel`, and Claude Code, which sends the same beta and field on Bedrock. It shipped without
|
|
47
|
+
a live Bedrock request. If an endpoint refuses it (a gateway, region, or account that does not
|
|
48
|
+
take the beta), the session resends that request once without it and leaves it out from then on,
|
|
49
|
+
as Claude Code does. A refusal is a 400 that says `block_binding: Extra inputs are not permitted`,
|
|
50
|
+
names the beta, or says `invalid beta flag`; those three matches come from Claude Code rather than
|
|
51
|
+
from recorded responses. A prefix mismatch is never treated as a refusal.
|
|
52
|
+
|
|
53
|
+
When the rejection arrives anyway, on Runtime or Mantle and whether or not the control was sent,
|
|
54
|
+
the session removes the rejected thinking from the request and asks again. That is the repair
|
|
55
|
+
Anthropic documents under "Remove the invalid thinking by hand" and the third layer Claude Code
|
|
56
|
+
keeps behind a stable prefix and the control. A rejection is a 400 whose message says
|
|
57
|
+
`bound to a different conversation` or `not created in this conversation`; the rest of the message
|
|
58
|
+
is documented as free to change and is not matched.
|
|
59
|
+
|
|
60
|
+
- The first rejection of a request removes the block the API names and every `thinking` and
|
|
61
|
+
`redacted_thinking` block after it. The position comes from the
|
|
62
|
+
`anthropic-thinking-prefix-mismatch` response header (`block=messages.N.content.M` among
|
|
63
|
+
`;`-separated pairs, ignored beyond 2048 characters) and otherwise from the
|
|
64
|
+
`messages.N.content.M` path in the error message. The API counts two adjacent messages of one
|
|
65
|
+
role as one, so its position can be lower than the adapter's; a position that does not land on a
|
|
66
|
+
thinking block of the request is not used, and all thinking is removed instead, as it is when
|
|
67
|
+
the API names no position.
|
|
68
|
+
- If the request is rejected the same way again, all remaining thinking is removed and it is sent
|
|
69
|
+
once more. There is no third step: one request costs at most two extra round trips, and a
|
|
70
|
+
rejection with nothing left to remove is reported as it is.
|
|
71
|
+
- Every other block is sent unchanged. An assistant message that held only thinking is sent with
|
|
72
|
+
the text `[Thinking removed]`, as Claude Code does, because the API refuses an empty assistant
|
|
73
|
+
message and leaving the message out would join two user turns. The adapter requests adaptive
|
|
74
|
+
thinking, which does not require an assistant turn to start with a thinking block; manual
|
|
75
|
+
(`enabled`) thinking does, and the adapter never sends it.
|
|
76
|
+
- The caller's history is never changed. The session remembers which blocks were rejected, by a
|
|
77
|
+
digest of their signature, and leaves them out of every later inference and compaction request,
|
|
78
|
+
so the failed round trip is paid once. Thinking produced after a removal is bound to the history
|
|
79
|
+
without those blocks, so they must stay out. A block is forgotten once the history no longer
|
|
80
|
+
holds it. The memory belongs to the session object: a new session for the same conversation (a
|
|
81
|
+
restarted process, or a caller that rebuilds its session) pays the failed round trip once more.
|
|
82
|
+
- Neither this nor giving up the control is a failed attempt, and neither changes how ordinary
|
|
83
|
+
failures are retried. Within one request the order is fixed: a refused control is given up
|
|
84
|
+
first, at most once per session, and rejected thinking is removed after that, at most twice.
|
|
85
|
+
- Nothing is removed once response content has started.
|
|
86
|
+
|
|
87
|
+
Removal costs the prompt cache from the first removed block and the model that reasoning. Like the
|
|
88
|
+
control, it shipped without a live Bedrock request: the matched phrases, the header, and the
|
|
89
|
+
`[Thinking removed]` text follow Claude Code and Anthropic's documentation, not recorded responses.
|
|
90
|
+
|
|
29
91
|
The transcript must end with a user turn, a tool result, or that native compaction checkpoint.
|
|
30
92
|
Claude models from 4.6 onward reject a trailing assistant message ("This model does not support
|
|
31
93
|
assistant message prefill"), and the adapter does not add or drop a turn to work around it:
|
|
@@ -201,6 +263,10 @@ session-level and selected-model tool definitions and leaves the caller's histor
|
|
|
201
263
|
`tests/anthropicBedrockToolReferences.test.ts` replays a search result that references a tool the
|
|
202
264
|
session no longer offers, with and without native tool search, through inference and compaction,
|
|
203
265
|
against a scripted endpoint that rejects dangling references the way Bedrock does.
|
|
266
|
+
`tests/anthropicBedrockThinkingBinding.test.ts` replays signed thinking through the real Runtime
|
|
267
|
+
SDK client against a scripted endpoint: the control on inference and compaction for a
|
|
268
|
+
prefix-checked model, its absence elsewhere, and the one-time renegotiation when an endpoint
|
|
269
|
+
refuses it.
|
|
204
270
|
`tests/anthropicBedrock.live.test.ts` performs a real preferred-endpoint turn and a real native
|
|
205
271
|
compaction followed by a checkpoint-replay turn when `RIG_LIVE_TEST=1` and a bearer token are
|
|
206
272
|
available.
|
package/VENDOR_CLAUDE.md
CHANGED
|
@@ -367,6 +367,23 @@ results. The listener is removed on normal completion, error, synchronous query-
|
|
|
367
367
|
failure, or cancellation. The same resources are also closed by `destroy()`, or when model,
|
|
368
368
|
effort, tools, prompt, or compaction mode changes.
|
|
369
369
|
|
|
370
|
+
A child using a stored Claude Code sign-in renews it itself: it spends the refresh token at the
|
|
371
|
+
token endpoint, then saves the new pair. The SDK stops a closed child with SIGTERM two seconds
|
|
372
|
+
after closing its input, so a stop landing between those steps used to leave a spent refresh
|
|
373
|
+
token in the store. The next renewal by any process was refused, and Claude Code then cleared the
|
|
374
|
+
sign-in shared by every session on that account until the person signed in again.
|
|
375
|
+
`impl/spawnClaudeCodeChild.ts` therefore spawns these children and holds every stop of one child
|
|
376
|
+
while that child is renewing. Claude Code names the holder of `.oauth_refresh.lock` in
|
|
377
|
+
`.oauth_refresh.lock.owner`, so a lock held by the terminal `claude` or another session does not
|
|
378
|
+
delay the stop; until the record names a holder, the child is assumed to be it. The stops of one
|
|
379
|
+
child share a single wait of 32 seconds, Claude Code 2.1.321's 30-second token request timeout plus
|
|
380
|
+
a margin. Claude Code touches a held lock every five seconds, so a lock untouched for ten seconds
|
|
381
|
+
counts as abandoned. The wait uses unreferenced timers and never delays daemon exit; a child left
|
|
382
|
+
behind still saves its renewal and exits once it sees its input closed. Tokens Rig passes in are
|
|
383
|
+
never renewed by the child, so those children use the SDK's own spawn. The Claude Code harness
|
|
384
|
+
spawns its children the same way and also defers its process-tree stop with
|
|
385
|
+
`afterClaudeCodeRenewal`.
|
|
386
|
+
|
|
370
387
|
## Trace and test coverage
|
|
371
388
|
|
|
372
389
|
`tests/vendors/captureClaudeTrace.mjs` captures vanilla CLI behavior with real inference,
|
package/VENDOR_CODEX.md
CHANGED
|
@@ -129,6 +129,12 @@ The reviewed model contracts are:
|
|
|
129
129
|
- `gpt-5.5`: ordinary Responses request shape, compaction hash `2911`, default medium effort;
|
|
130
130
|
- `gpt-6-astra`: Responses Lite by default and ordinary Responses for parallel tool calls,
|
|
131
131
|
compaction hash `3000`, default low effort, and API efforts low through max;
|
|
132
|
+
- `gpt-6.2-astra` and `gpt-6.2-sol`: Codex subscription windows of 272,000 and 500,000 tokens
|
|
133
|
+
from OpenAI's Codex models page; Codex's `models.json` has no 6.2 entry yet, so the rest of the
|
|
134
|
+
contract (Responses Lite, hash `3000`, default low effort) follows GPT-6.1 Sol. The API rejects
|
|
135
|
+
effort `none`. Bedrock IDs follow the GPT-6 pattern (`openai.gpt-6.2-astra` on Mantle,
|
|
136
|
+
`global.openai.gpt-6.2-astra` on Runtime by default) before AWS documents them; not yet
|
|
137
|
+
verified live;
|
|
132
138
|
- `gpt-6.1-sol`: same contract as Astra with default low effort, as Codex's `models.json` lists
|
|
133
139
|
it; not served by Bedrock, which documents no GPT-6.1 model, and not yet verified live;
|
|
134
140
|
- `gpt-6-sol`: same contract as Astra with default low effort; live tool-less inference verified
|
|
@@ -78,10 +78,16 @@ export type SessionEvent = {
|
|
|
78
78
|
content: readonly SessionOutputBlock[];
|
|
79
79
|
isError?: boolean;
|
|
80
80
|
incomplete?: boolean;
|
|
81
|
-
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A provider-owned retry is about to start. `providerError` classifies the failure being
|
|
84
|
+
* retried when the provider knows it, in the same vocabulary as a terminal error.
|
|
85
|
+
*/
|
|
86
|
+
| {
|
|
82
87
|
type: "retrying";
|
|
83
88
|
attempt: number;
|
|
84
89
|
reason: string;
|
|
90
|
+
providerError?: SessionProviderError;
|
|
85
91
|
} | {
|
|
86
92
|
type: "token_usage";
|
|
87
93
|
usage: SessionUsage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionEvent.d.ts","sourceRoot":"","sources":["../../sources/core/SessionEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,YAAY,EACR,oBAAoB,EACpB,+BAA+B,GAClC,MAAM,gCAAgC,CAAC;AAExC,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzF,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,eAAe,GAAG,SAAS,CAAC;AAEnG,MAAM,WAAW,aAAa;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B;AAED,4DAA4D;AAC5D,MAAM,MAAM,YAAY,GAClB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;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CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3E;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GACxD;IACI,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACxC,CAAC;AAER,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAExD,wBAAgB,kBAAkB,CAC9B,KAAK,EAAE,YAAY,GACpB,KAAK,IAAI,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAElD;AAED,wBAAgB,kBAAkB,CAC9B,KAAK,EAAE,YAAY,GACpB,KAAK,IAAI,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAElE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionEvent.js","sourceRoot":"","sources":["../../sources/core/SessionEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SessionEvent.js","sourceRoot":"","sources":["../../sources/core/SessionEvent.ts"],"names":[],"mappings":"AA0FA,MAAM,UAAU,kBAAkB,CAC9B,KAAmB;IAEnB,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAC9B,KAAmB;IAEnB,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,OAAO,CAAC;AAC5D,CAAC"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* where a compiled binary has no `package.json` to read. A test keeps it equal to the package's own
|
|
4
4
|
* version, so a release that bumps one without the other fails before it publishes.
|
|
5
5
|
*/
|
|
6
|
-
export declare const HAPPY_PROVIDERS_VERSION = "0.0.
|
|
6
|
+
export declare const HAPPY_PROVIDERS_VERSION = "0.0.63";
|
|
7
7
|
//# sourceMappingURL=happyProvidersVersion.d.ts.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* where a compiled binary has no `package.json` to read. A test keeps it equal to the package's own
|
|
4
4
|
* version, so a release that bumps one without the other fails before it publishes.
|
|
5
5
|
*/
|
|
6
|
-
export const HAPPY_PROVIDERS_VERSION = "0.0.
|
|
6
|
+
export const HAPPY_PROVIDERS_VERSION = "0.0.63";
|
|
7
7
|
//# sourceMappingURL=happyProvidersVersion.js.map
|
|
@@ -3,11 +3,19 @@ import type { SessionContext } from "../../core/SessionContext.js";
|
|
|
3
3
|
import type { SessionReasoningEffort, SessionStructuredOutput } from "../../core/SessionRunRequest.js";
|
|
4
4
|
import type { SessionTool } from "../../core/SessionTool.js";
|
|
5
5
|
export type AnthropicRequest = MessageCreateParamsStreaming;
|
|
6
|
+
/** The beta that makes `thinking.block_binding` a legal request field. */
|
|
7
|
+
export declare const ANTHROPIC_THINKING_BINDING_BETA = "thinking-binding-controls-2026-08-01";
|
|
6
8
|
export declare function createAnthropicRequest(options: {
|
|
7
9
|
compaction?: {
|
|
8
10
|
instructions?: string;
|
|
9
11
|
};
|
|
10
12
|
context: SessionContext;
|
|
13
|
+
/**
|
|
14
|
+
* Ask the API to drop replayed thinking blocks that fail its prefix check instead of
|
|
15
|
+
* rejecting the whole request. The caller says whether the model and endpoint accept the
|
|
16
|
+
* control; it is never sent with thinking disabled, where the API refuses the field.
|
|
17
|
+
*/
|
|
18
|
+
dropMismatchedThinking?: boolean;
|
|
11
19
|
effort?: SessionReasoningEffort;
|
|
12
20
|
model: string;
|
|
13
21
|
structuredOutput?: SessionStructuredOutput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnthropicRequest.d.ts","sourceRoot":"","sources":["../../../sources/protocol/anthropic/createAnthropicRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"createAnthropicRequest.d.ts","sourceRoot":"","sources":["../../../sources/protocol/anthropic/createAnthropicRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,4BAA4B,EAC/B,MAAM,oDAAoD,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACnG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AASzD,MAAM,MAAM,gBAAgB,GAAG,4BAA4B,CAAC;AAE5D,0EAA0E;AAC1E,eAAO,MAAM,+BAA+B,yCAAyC,CAAC;AAEtF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAC5C,UAAU,CAAC,EAAE;QACT,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;CACjC,GAAG,gBAAgB,CAiFnB"}
|
|
@@ -2,6 +2,8 @@ import { withAnthropicToolReferences } from "../../protocol/anthropic/anthropicT
|
|
|
2
2
|
import { toAnthropicMessages } from "../../protocol/anthropic/toAnthropicMessages.js";
|
|
3
3
|
import { toAnthropicSystem } from "../../protocol/anthropic/toAnthropicSystem.js";
|
|
4
4
|
import { isAnthropicToolSearchTool, toAnthropicTools, } from "../../protocol/anthropic/toAnthropicTools.js";
|
|
5
|
+
/** The beta that makes `thinking.block_binding` a legal request field. */
|
|
6
|
+
export const ANTHROPIC_THINKING_BINDING_BETA = "thinking-binding-controls-2026-08-01";
|
|
5
7
|
export function createAnthropicRequest(options) {
|
|
6
8
|
const effort = resolveEffort(options.effort);
|
|
7
9
|
const system = toAnthropicSystem(options);
|
|
@@ -18,6 +20,9 @@ export function createAnthropicRequest(options) {
|
|
|
18
20
|
if (hasToolSearch) {
|
|
19
21
|
betas.push("tool-search-tool-2025-10-19");
|
|
20
22
|
}
|
|
23
|
+
const dropsMismatchedThinking = options.dropMismatchedThinking === true && options.effort !== "off";
|
|
24
|
+
if (dropsMismatchedThinking)
|
|
25
|
+
betas.push(ANTHROPIC_THINKING_BINDING_BETA);
|
|
21
26
|
return {
|
|
22
27
|
betas,
|
|
23
28
|
...(!usesCompaction
|
|
@@ -51,7 +56,15 @@ export function createAnthropicRequest(options) {
|
|
|
51
56
|
model: options.model,
|
|
52
57
|
stream: true,
|
|
53
58
|
...(system.length === 0 ? {} : { system }),
|
|
54
|
-
thinking: options.effort === "off"
|
|
59
|
+
thinking: options.effort === "off"
|
|
60
|
+
? { type: "disabled" }
|
|
61
|
+
: dropsMismatchedThinking
|
|
62
|
+
? // The SDK does not type `block_binding` yet; the wire shape is the API's.
|
|
63
|
+
{
|
|
64
|
+
type: "adaptive",
|
|
65
|
+
block_binding: { prefix_mismatch_behavior: "drop_block" },
|
|
66
|
+
}
|
|
67
|
+
: { type: "adaptive" },
|
|
55
68
|
...(options.effort === "off" && options.structuredOutput === undefined
|
|
56
69
|
? {}
|
|
57
70
|
: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAnthropicRequest.js","sourceRoot":"","sources":["../../../sources/protocol/anthropic/createAnthropicRequest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createAnthropicRequest.js","sourceRoot":"","sources":["../../../sources/protocol/anthropic/createAnthropicRequest.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EACH,yBAAyB,EACzB,gBAAgB,GACnB,MAAM,0CAA0C,CAAC;AAIlD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,+BAA+B,GAAG,sCAAsC,CAAC;AAEtF,MAAM,UAAU,sBAAsB,CAAC,OAetC;IACG,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACpE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,2BAA2B,CACnD,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAC7C,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,EAC/B,aAAa,CAChB,CAAC;IACF,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;IAChG,MAAM,kBAAkB,GAAG,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC;IAC5D,MAAM,cAAc,GAAG,kBAAkB,IAAI,aAAa,CAAC;IAC3D,MAAM,KAAK,GAAG,CAAC,uBAAuB,EAAE,iCAA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AAM,CAAC;AAClB,CAAC"}
|
|
@@ -43,6 +43,15 @@ export declare class AnthropicBedrockSession extends BaseSession {
|
|
|
43
43
|
private context;
|
|
44
44
|
private readonly modelConfigurations;
|
|
45
45
|
private readonly resolveInferenceMaxRetries;
|
|
46
|
+
/** Set once the endpoint refuses the thinking-binding control; it is not sent again. */
|
|
47
|
+
private thinkingBindingRefused;
|
|
48
|
+
/**
|
|
49
|
+
* Thinking blocks the API rejected as bound to a different conversation, by identity. They
|
|
50
|
+
* stay in the caller's history, so every later request of this session leaves them out again:
|
|
51
|
+
* thinking produced since is bound to a history without them, and putting them back would
|
|
52
|
+
* fail it too. An identity is forgotten once the history no longer holds its block.
|
|
53
|
+
*/
|
|
54
|
+
private readonly removedThinking;
|
|
46
55
|
private readonly emptyResponseRetryWait;
|
|
47
56
|
constructor(id: string, options: AnthropicBedrockSessionOptions);
|
|
48
57
|
run(ctx: Context, request: SessionRunRequest): SessionStream;
|
|
@@ -51,6 +60,23 @@ export declare class AnthropicBedrockSession extends BaseSession {
|
|
|
51
60
|
private streamRun;
|
|
52
61
|
private streamQuery;
|
|
53
62
|
private createRequest;
|
|
63
|
+
/**
|
|
64
|
+
* The request to send instead after the API rejected replayed thinking as bound to a
|
|
65
|
+
* different conversation, or `undefined` when the rejection is something else or nothing is
|
|
66
|
+
* left to remove.
|
|
67
|
+
*
|
|
68
|
+
* The first rejection of a request removes the block the API named and all thinking after
|
|
69
|
+
* it, which is the API's documented repair; when it names none, or the name does not land on
|
|
70
|
+
* a thinking block, all thinking goes. A second rejection removes whatever thinking is left.
|
|
71
|
+
* There is no third step, so one request costs at most two extra round trips. What was
|
|
72
|
+
* removed is remembered for the session, so later requests do not send it and fail again.
|
|
73
|
+
*/
|
|
74
|
+
private withoutRejectedThinking;
|
|
75
|
+
/**
|
|
76
|
+
* Whether this failure is the endpoint refusing the thinking-binding control the request
|
|
77
|
+
* carried. Remembers a refusal, so the session's later requests leave the control out.
|
|
78
|
+
*/
|
|
79
|
+
private refusesThinkingBinding;
|
|
54
80
|
private resolveTools;
|
|
55
81
|
}
|
|
56
82
|
//# sourceMappingURL=AnthropicBedrockSession.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnthropicBedrockSession.d.ts","sourceRoot":"","sources":["../../../sources/vendors/bedrock/AnthropicBedrockSession.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAEH,KAAK,qBAAqB,EAC7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAG/F,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,KAAK,EAA0B,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"AnthropicBedrockSession.d.ts","sourceRoot":"","sources":["../../../sources/vendors/bedrock/AnthropicBedrockSession.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAEH,KAAK,qBAAqB,EAC7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAG/F,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,KAAK,EAA0B,iBAAiB,EAAE,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AC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAEvC,OAAO,CAAC,YAAY,CAAqC;IACzD,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;IACxD,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAEpB;IAChB,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAe;IAC1D,wFAAwF;IACxF,OAAO,CAAC,sBAAsB,CAAS;IACvC;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IACrD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAErC;IAEF,YAAY,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B,EAwB9D;IAED,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,GAAG,aAAa,CAG3D;IAEK,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAoFzF;IAED,OAAO,IAAI,IAAI,CAEd;YAEc,SAAS;YAwCT,WAAW;IA4H1B,OAAO,CAAC,aAAa;IAqDrB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,uBAAuB;IAe/B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,YAAY;CAWvB"}
|
|
@@ -7,7 +7,9 @@ import { waitForInferenceRetry } from "../../core/waitForInferenceRetry.js";
|
|
|
7
7
|
import { describeAnthropicBedrockRetry, isAnthropicBedrockConnectionFailure, isRetryableAnthropicBedrockStreamError, resolveAnthropicBedrockRetryDelay, shouldRetryAnthropicBedrock, waitForAnthropicBedrockRetry, } from "../../vendors/bedrock/impl/anthropicBedrockRetry.js";
|
|
8
8
|
import { classifyAnthropicBedrockError, classifyAnthropicBedrockProviderError, describeAnthropicBedrockErrorMessage, } from "../../vendors/bedrock/errors/anthropicBedrockErrors.js";
|
|
9
9
|
import { AnthropicBedrockConnection } from "../../vendors/bedrock/impl/AnthropicBedrockConnection.js";
|
|
10
|
-
import {
|
|
10
|
+
import { carriesAnthropicThinkingBinding, dropsMismatchedAnthropicBedrockThinking, isAnthropicThinkingBindingRefusal, } from "../../vendors/bedrock/impl/anthropicBedrockThinkingBinding.js";
|
|
11
|
+
import { anthropicThinkingMismatchPosition, anthropicThinkingToRemove, isAnthropicThinkingPrefixMismatch, withoutAnthropicThinking, } from "../../vendors/bedrock/impl/anthropicBedrockThinkingHeal.js";
|
|
12
|
+
import { createAnthropicRequest, } from "../../protocol/anthropic/createAnthropicRequest.js";
|
|
11
13
|
import { mapAnthropicStream } from "../../protocol/anthropic/mapAnthropicStream.js";
|
|
12
14
|
import { pendingAnthropicServerTools } from "../../protocol/anthropic/anthropicServerToolContinuation.js";
|
|
13
15
|
import { requestAnthropicBedrockCompaction } from "../../vendors/bedrock/impl/requestAnthropicBedrockCompaction.js";
|
|
@@ -28,6 +30,15 @@ export class AnthropicBedrockSession extends BaseSession {
|
|
|
28
30
|
context;
|
|
29
31
|
modelConfigurations;
|
|
30
32
|
resolveInferenceMaxRetries;
|
|
33
|
+
/** Set once the endpoint refuses the thinking-binding control; it is not sent again. */
|
|
34
|
+
thinkingBindingRefused = false;
|
|
35
|
+
/**
|
|
36
|
+
* Thinking blocks the API rejected as bound to a different conversation, by identity. They
|
|
37
|
+
* stay in the caller's history, so every later request of this session leaves them out again:
|
|
38
|
+
* thinking produced since is bound to a history without them, and putting them back would
|
|
39
|
+
* fail it too. An identity is forgotten once the history no longer holds its block.
|
|
40
|
+
*/
|
|
41
|
+
removedThinking = new Set();
|
|
31
42
|
emptyResponseRetryWait;
|
|
32
43
|
constructor(id, options) {
|
|
33
44
|
super(id);
|
|
@@ -73,19 +84,42 @@ export class AnthropicBedrockSession extends BaseSession {
|
|
|
73
84
|
}
|
|
74
85
|
this.activeModel = model;
|
|
75
86
|
try {
|
|
76
|
-
const
|
|
87
|
+
const compact = async (request) => await requestAnthropicBedrockCompaction({
|
|
77
88
|
client: this.connection.client(),
|
|
78
89
|
maxRetries: this.resolveInferenceMaxRetries(),
|
|
79
|
-
request
|
|
80
|
-
compactionInstructions: options.instructions ?? null,
|
|
81
|
-
context: original,
|
|
82
|
-
model,
|
|
83
|
-
// Use the selected model's normal tools: replayed native tool-search results
|
|
84
|
-
// reference their definitions even when generation pauses after compaction.
|
|
85
|
-
...(this.activeEffort === undefined ? {} : { effort: this.activeEffort }),
|
|
86
|
-
}),
|
|
90
|
+
request,
|
|
87
91
|
...(signal === undefined ? {} : { signal }),
|
|
88
92
|
});
|
|
93
|
+
const createRequest = () => this.createRequest({
|
|
94
|
+
compactionInstructions: options.instructions ?? null,
|
|
95
|
+
context: original,
|
|
96
|
+
model,
|
|
97
|
+
// Use the selected model's normal tools: replayed native tool-search results
|
|
98
|
+
// reference their definitions even when generation pauses after compaction.
|
|
99
|
+
...(this.activeEffort === undefined ? {} : { effort: this.activeEffort }),
|
|
100
|
+
});
|
|
101
|
+
// The same bounded renegotiation as inference: the control is dropped at most once
|
|
102
|
+
// for the session, and rejected thinking is removed in at most two steps.
|
|
103
|
+
let request = createRequest();
|
|
104
|
+
let healed = 0;
|
|
105
|
+
let native;
|
|
106
|
+
while (true) {
|
|
107
|
+
try {
|
|
108
|
+
native = await compact(request);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
if (this.refusesThinkingBinding(request, error)) {
|
|
113
|
+
request = createRequest();
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const without = this.withoutRejectedThinking(request, error, healed);
|
|
117
|
+
if (without === undefined)
|
|
118
|
+
throw error;
|
|
119
|
+
healed += 1;
|
|
120
|
+
request = without;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
89
123
|
if (signal?.aborted)
|
|
90
124
|
return { status: "cancelled", context: original };
|
|
91
125
|
if (native.block === undefined) {
|
|
@@ -167,8 +201,9 @@ export class AnthropicBedrockSession extends BaseSession {
|
|
|
167
201
|
let attempts = 0;
|
|
168
202
|
try {
|
|
169
203
|
const tools = this.resolveTools(options.model, options.tools);
|
|
170
|
-
|
|
204
|
+
let request = this.createRequest({ ...options, tools });
|
|
171
205
|
let failedAttempts = 0;
|
|
206
|
+
let healed = 0;
|
|
172
207
|
while (true) {
|
|
173
208
|
let responseContentStarted = false;
|
|
174
209
|
let compactionOutputStarted = false;
|
|
@@ -196,6 +231,23 @@ export class AnthropicBedrockSession extends BaseSession {
|
|
|
196
231
|
return;
|
|
197
232
|
}
|
|
198
233
|
catch (error) {
|
|
234
|
+
// An endpoint that does not take the thinking-binding control rejects the
|
|
235
|
+
// request before it runs. Ask again without it; that is not a failed attempt.
|
|
236
|
+
if (!responseContentStarted && this.refusesThinkingBinding(request, error)) {
|
|
237
|
+
request = this.createRequest({ ...options, tools });
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
// Replayed thinking whose prefix changed is rejected before anything runs,
|
|
241
|
+
// and the same request can never pass. Leave the rejected thinking out and
|
|
242
|
+
// ask again; that is not a failed attempt either.
|
|
243
|
+
const without = responseContentStarted
|
|
244
|
+
? undefined
|
|
245
|
+
: this.withoutRejectedThinking(request, error, healed);
|
|
246
|
+
if (without !== undefined) {
|
|
247
|
+
healed += 1;
|
|
248
|
+
request = without;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
199
251
|
// A connection that drops mid-response, or a retryable error event the
|
|
200
252
|
// server sent on the open stream, is replayed through the block_reset
|
|
201
253
|
// rollback below, unless compaction output began: compaction is stateful on
|
|
@@ -263,10 +315,17 @@ export class AnthropicBedrockSession extends BaseSession {
|
|
|
263
315
|
instructions: modelConfiguration.instructions,
|
|
264
316
|
messages: options.context.messages,
|
|
265
317
|
};
|
|
266
|
-
|
|
318
|
+
const wireModel = mappedBedrockModelId(this.bedrockModelIds, options.model) ??
|
|
319
|
+
resolveAnthropicBedrockModelId(options.model, this.region, this.transport);
|
|
320
|
+
const request = createAnthropicRequest({
|
|
267
321
|
context,
|
|
268
|
-
|
|
269
|
-
|
|
322
|
+
dropMismatchedThinking: !this.thinkingBindingRefused &&
|
|
323
|
+
dropsMismatchedAnthropicBedrockThinking({
|
|
324
|
+
model: options.model,
|
|
325
|
+
transport: this.transport,
|
|
326
|
+
wireModel,
|
|
327
|
+
}),
|
|
328
|
+
model: wireModel,
|
|
270
329
|
...(options.structuredOutput === undefined
|
|
271
330
|
? {}
|
|
272
331
|
: { structuredOutput: options.structuredOutput }),
|
|
@@ -280,6 +339,50 @@ export class AnthropicBedrockSession extends BaseSession {
|
|
|
280
339
|
}),
|
|
281
340
|
...(options.effort === undefined ? {} : { effort: options.effort }),
|
|
282
341
|
});
|
|
342
|
+
if (this.removedThinking.size === 0)
|
|
343
|
+
return request;
|
|
344
|
+
// Compaction and rewinding take rejected thinking out of the history for good.
|
|
345
|
+
const present = new Set(anthropicThinkingToRemove(request, undefined));
|
|
346
|
+
for (const identity of this.removedThinking) {
|
|
347
|
+
if (!present.has(identity))
|
|
348
|
+
this.removedThinking.delete(identity);
|
|
349
|
+
}
|
|
350
|
+
return withoutAnthropicThinking(request, this.removedThinking);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* The request to send instead after the API rejected replayed thinking as bound to a
|
|
354
|
+
* different conversation, or `undefined` when the rejection is something else or nothing is
|
|
355
|
+
* left to remove.
|
|
356
|
+
*
|
|
357
|
+
* The first rejection of a request removes the block the API named and all thinking after
|
|
358
|
+
* it, which is the API's documented repair; when it names none, or the name does not land on
|
|
359
|
+
* a thinking block, all thinking goes. A second rejection removes whatever thinking is left.
|
|
360
|
+
* There is no third step, so one request costs at most two extra round trips. What was
|
|
361
|
+
* removed is remembered for the session, so later requests do not send it and fail again.
|
|
362
|
+
*/
|
|
363
|
+
withoutRejectedThinking(request, error, healed) {
|
|
364
|
+
if (healed >= 2 || !isAnthropicThinkingPrefixMismatch(error))
|
|
365
|
+
return undefined;
|
|
366
|
+
const rejected = anthropicThinkingToRemove(request, healed === 0 ? anthropicThinkingMismatchPosition(error) : undefined);
|
|
367
|
+
if (rejected.length === 0)
|
|
368
|
+
return undefined;
|
|
369
|
+
for (const identity of rejected)
|
|
370
|
+
this.removedThinking.add(identity);
|
|
371
|
+
return withoutAnthropicThinking(request, this.removedThinking);
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Whether this failure is the endpoint refusing the thinking-binding control the request
|
|
375
|
+
* carried. Remembers a refusal, so the session's later requests leave the control out.
|
|
376
|
+
*/
|
|
377
|
+
refusesThinkingBinding(request, error) {
|
|
378
|
+
if (this.thinkingBindingRefused)
|
|
379
|
+
return false;
|
|
380
|
+
if (!carriesAnthropicThinkingBinding(request))
|
|
381
|
+
return false;
|
|
382
|
+
if (!isAnthropicThinkingBindingRefusal(error))
|
|
383
|
+
return false;
|
|
384
|
+
this.thinkingBindingRefused = true;
|
|
385
|
+
return true;
|
|
283
386
|
}
|
|
284
387
|
resolveTools(model, tools) {
|
|
285
388
|
return (tools ??
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnthropicBedrockSession.js","sourceRoot":"","sources":["../../../sources/vendors/bedrock/AnthropicBedrockSession.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EACH,iCAAiC,GAEpC,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;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B;QACtC,KAAK,CAAC,IAAI,KAAK,qBAAqB,CACvC,CAAC;AACN,CAAC"}
|
|
1
|
+
{"version":3,"file":"AnthropicBedrockSession.js","sourceRoot":"","sources":["../../../sources/vendors/bedrock/AnthropicBedrockSession.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,qBAAqB,EACrB,oBAAoB,GACvB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EACH,iCAAiC,GAEpC,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AAKlG,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,OAAO,EACH,6BAA6B,EAC7B,mCAAmC,EACnC,sCAAsC,EACtC,iCAAiC,EACjC,2BAA2B,EAC3B,4BAA4B,GAC/B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACH,6BAA6B,EAC7B,qCAAqC,EACrC,oCAAoC,GACvC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAClG,OAAO,EACH,+BAA+B,EAC/B,uCAAuC,EACvC,iCAAiC,GACpC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EACH,iCAAiC,EACjC,yBAAyB,EACzB,iCAAiC,EACjC,wBAAwB,GAC3B,MAAM,wDAAwD,CAAC;AAEhE,OAAO,EACH,sBAAsB,GAEzB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EAAE,iCAAiC,EAAE,MAAM,6DAA6D,CAAC;AAChH,OAAO,EAAE,8BAA8B,EAAE,MAAM,0DAA0D,CAAC;AAC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vC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AnthropicRequest } from "../../../protocol/anthropic/createAnthropicRequest.js";
|
|
2
|
+
import type { AnthropicBedrockTransport } from "../../../vendors/bedrock/AnthropicBedrockTransport.js";
|
|
3
|
+
/**
|
|
4
|
+
* Whether a request should ask Bedrock to drop mismatched thinking instead of failing.
|
|
5
|
+
*
|
|
6
|
+
* A caller's system prompt and tools legitimately change during a conversation, and one changed
|
|
7
|
+
* byte would otherwise end it for good, because the stored history still holds the old thinking.
|
|
8
|
+
* Claude Code sends the same control for the same reason. Only Runtime is covered: AWS documents
|
|
9
|
+
* the control for `InvokeModel`, and Fable 5.2 is served nowhere else on Bedrock. A model named
|
|
10
|
+
* only by an opaque ARN cannot be recognized and keeps the API's default.
|
|
11
|
+
*/
|
|
12
|
+
export declare function dropsMismatchedAnthropicBedrockThinking(options: {
|
|
13
|
+
model: string;
|
|
14
|
+
transport: AnthropicBedrockTransport;
|
|
15
|
+
wireModel: string;
|
|
16
|
+
}): boolean;
|
|
17
|
+
export declare function carriesAnthropicThinkingBinding(request: AnthropicRequest): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Recognizes an endpoint that does not take the control at all: a gateway, region, or account
|
|
20
|
+
* that rejects the field or its beta. Sending it again would fail every request, so the session
|
|
21
|
+
* stops sending it. The three messages are the ones Claude Code gives up on.
|
|
22
|
+
*
|
|
23
|
+
* A prefix mismatch is not a refusal. It also names the beta when a proxy removed it on the way,
|
|
24
|
+
* and resending without the control could only repeat it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isAnthropicThinkingBindingRefusal(error: unknown): boolean;
|
|
27
|
+
//# sourceMappingURL=anthropicBedrockThinkingBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropicBedrockThinkingBinding.d.ts","sourceRoot":"","sources":["../../../../sources/vendors/bedrock/impl/anthropicBedrockThinkingBinding.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,gBAAgB,EACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAoBhG;;;;;;;;GAQG;AACH,wBAAgB,uCAAuC,CAAC,OAAO,EAAE;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,yBAAyB,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAMV;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAElF;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAWzE"}
|