@ouro.bot/cli 0.1.0-alpha.126 → 0.1.0-alpha.127
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.json +6 -0
- package/dist/heart/providers/anthropic.js +14 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.127",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Anthropic OAuth tokens now work with Opus and Sonnet 4.6. Added Claude Code identification in system prompt and headers that the API requires to grant model access to setup tokens."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.126",
|
|
6
12
|
"changes": [
|
|
@@ -270,8 +270,17 @@ async function streamAnthropicMessages(client, model, request) {
|
|
|
270
270
|
thinking: { type: "adaptive" },
|
|
271
271
|
output_config: { effort: request.reasoningEffort ?? "medium" },
|
|
272
272
|
};
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
// The Anthropic API requires a Claude Code identification block in the system
|
|
274
|
+
// prompt when using OAuth setup tokens (sk-ant-oat01). Without it, Opus/Sonnet
|
|
275
|
+
// 4.6 requests are rejected with 400. This is the API's validation that the
|
|
276
|
+
// token is being used by a Claude Code client.
|
|
277
|
+
const claudeCodePreamble = { type: "text", text: "You are Claude Code, Anthropic's official CLI for Claude." };
|
|
278
|
+
if (system) {
|
|
279
|
+
params.system = [claudeCodePreamble, { type: "text", text: system }];
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
params.system = [claudeCodePreamble];
|
|
283
|
+
}
|
|
275
284
|
if (anthropicTools.length > 0)
|
|
276
285
|
params.tools = anthropicTools;
|
|
277
286
|
if (request.toolChoiceRequired && anthropicTools.length > 0) {
|
|
@@ -434,6 +443,9 @@ function createAnthropicProviderRuntime(config) {
|
|
|
434
443
|
maxRetries: 0,
|
|
435
444
|
defaultHeaders: {
|
|
436
445
|
"anthropic-beta": ANTHROPIC_OAUTH_BETA_HEADER,
|
|
446
|
+
"anthropic-dangerous-direct-browser-access": "true",
|
|
447
|
+
"user-agent": "claude-cli/2.1.2 (external, cli)",
|
|
448
|
+
"x-app": "cli",
|
|
437
449
|
},
|
|
438
450
|
});
|
|
439
451
|
}
|