Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alphaxiv/agents",
"version": "0.6.1",
"version": "0.6.3",
"license": "MIT",
"fmt": {
"lineWidth": 120
Expand Down
5 changes: 5 additions & 0 deletions src/adapters/anthropic/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function extended<const T extends readonly [ThinkingLevel, ...ThinkingLevel[]]>(

const anthropicModelThinkingSupportDefinition = {
// Adaptive thinking only (effort controls thinking intensity)
"claude-opus-4-8": adaptive({
levels: ["low", "medium", "high", "xhigh", "max"],
default: "high",
}),
"claude-opus-4-7": adaptive({
levels: ["low", "medium", "high", "xhigh", "max"],
default: "high",
Expand Down Expand Up @@ -171,6 +175,7 @@ export type SupportsInterleaved<TModel extends AnthropicModels> = ModelConfig<TM
* Model support for native structured ouput.
*/
export const anthropicModelStructuredOutputSupport = {
"claude-opus-4-8": true,
"claude-opus-4-7": true,
"claude-opus-4-6": true,
"claude-sonnet-4-6": true,
Expand Down
1 change: 1 addition & 0 deletions src/adapters/anthropic/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface ExtendedThinkingSupport<T extends string> {
}

export interface AnthropicModelThinkingSupportMap {
"claude-opus-4-8": AdaptiveThinkingSupport<"low" | "medium" | "high" | "xhigh" | "max">;
"claude-opus-4-7": AdaptiveThinkingSupport<"low" | "medium" | "high" | "xhigh" | "max">;
"claude-opus-4-6": AdaptiveThinkingSupport<"low" | "medium" | "high" | "max">;
"claude-sonnet-4-6": AdaptiveOrExtendedThinkingSupport<
Expand Down
11 changes: 11 additions & 0 deletions src/adapters/openai/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ function reasoning<const T extends readonly [OpenAIReasoningEffort, ...OpenAIRea

const openAiModelsDefinition = {
// Frontier
"gpt-5.5": reasoning({
levels: ["none", "low", "medium", "high", "xhigh"],
default: "medium",
modalities: ["text", "image"],
}),
"gpt-5.5-pro": reasoning({
levels: ["medium", "high", "xhigh"],
default: "medium",
modalities: ["text", "image"],
}),

"gpt-5.4": reasoning({
levels: ["none", "low", "medium", "high", "xhigh"],
default: "medium",
Expand Down
2 changes: 2 additions & 0 deletions src/adapters/openai/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export interface ReasoningModelSupport<T extends readonly [string, ...string[]]>
}

export interface OpenAiModelsMap {
"gpt-5.5": ReasoningModelSupport<["none", "low", "medium", "high", "xhigh"]>;
"gpt-5.5-pro": ReasoningModelSupport<["medium", "high", "xhigh"]>;
"gpt-5.4": ReasoningModelSupport<["none", "low", "medium", "high", "xhigh"]>;
"gpt-5.4-pro": ReasoningModelSupport<["medium", "high", "xhigh"]>;
"gpt-5.4-mini": ReasoningModelSupport<["none", "low", "medium", "high"]>;
Expand Down
54 changes: 54 additions & 0 deletions tests/adapters/anthropic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,34 @@ import type { Adapter } from "../../src/adapters/adapter.ts";

const HAS_ANTHROPIC_KEY = Boolean(Deno.env.get("ANTHROPIC_API_KEY"));

Deno.test({
name: "AnthropicAdapter streams a parameterized tool call (claude-opus-4-8, adaptive)",
ignore: !HAS_ANTHROPIC_KEY,
sanitizeOps: false,
sanitizeResources: false,
async fn(t) {
const fixtures = createToolFixtures();
const adapter = anthropicModel({
model: "claude-opus-4-8",
effort: "high",
});

await runAdapterToolStreamingTest(t, {
stream: adapter.stream({
history: [{
type: "input_text",
content: `Call ${fixtures.echoTool.normalizedName} exactly once with {\"query\":\"${fixtures.query}\"}.`,
}],
instructions: "You are a compliant live integration test assistant.",
tools: [fixtures.echoTool],
signal: AbortSignal.timeout(INTEGRATION_TIMEOUT_MS),
}),
toolName: fixtures.echoTool.normalizedName,
expectedContentSubstring: fixtures.query,
});
},
});

Deno.test({
name: "AnthropicAdapter streams a parameterized tool call (claude-opus-4-7, adaptive)",
ignore: !HAS_ANTHROPIC_KEY,
Expand Down Expand Up @@ -76,6 +104,18 @@ Deno.test({
},
});

Deno.test({
name: "AnthropicModel streams tools and results (claude-opus-4-8, adaptive-only)",
ignore: !HAS_ANTHROPIC_KEY,
sanitizeOps: false,
sanitizeResources: false,
async fn(t) {
await runAgentToolStreamingTest(t, {
model: anthropicModel({ model: "claude-opus-4-8", effort: "low" }),
});
},
});

Deno.test({
name: "AnthropicModel streams tools and results (claude-opus-4-7, adaptive-only)",
ignore: !HAS_ANTHROPIC_KEY,
Expand All @@ -100,6 +140,20 @@ Deno.test({
},
});

Deno.test({
name: "claude-opus-4-8 works with",
fn() {
assertEquals(
getAnthropicMessagesStreamConfig({ model: "claude-opus-4-8", effort: "xhigh" }),
{
thinking: { type: "adaptive", display: "summarized" },
output_config: { effort: "xhigh" },
betas: undefined,
},
);
},
});

Deno.test({
name: "claude-opus-4-7 works with",
fn() {
Expand Down
12 changes: 12 additions & 0 deletions tests/adapters/openai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ Deno.test({
},
});

Deno.test({
name: "OpenAIModel streams tools and results (gpt-5.5, reasoning)",
ignore: !HAS_OPENAI_KEY,
sanitizeOps: false,
sanitizeResources: false,
async fn(t) {
await runAgentToolStreamingTest(t, {
model: openAIModel({ model: "gpt-5.5", effort: "low" }),
});
},
});

Deno.test({
name: "OpenAIModel streams tools and results (gpt-5.4, reasoning)",
ignore: !HAS_OPENAI_KEY,
Expand Down
Loading