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 .agents/docs/agent-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Model/effort lists below are the **statically declared defaults**. Several provi

| Provider | Models | Efforts | Live Input | Structured Session |
| ------------ | ------------------------------------------------------ | ---------------------------------------- | --------------------- | ---------------------- |
| Claude | opus-4-8, opus-4-7, opus-4-6, sonnet, haiku | low, medium, high, xHigh, max, ultracode | terminal | No |
| Claude | opus-4-8, fable-5, opus-4-7, opus-4-6, sonnet, haiku | low, medium, high, xHigh, max, ultracode | terminal | No |
| Codex | (probed dynamically via app-server) | (probed dynamically) | terminal / GUI server | Yes (stdio app-server) |
| Gemini | (probed dynamically via ACP) | (probed dynamically) | terminal | No |
| Copilot | (probed via ACP) | (probed via ACP) | terminal | Yes (ACP) |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"dependencies": {
"@agentclientprotocol/sdk": "^0.21.1",
"@anthropic-ai/claude-agent-sdk": "^0.3.154",
"@anthropic-ai/claude-agent-sdk": "^0.3.170",
"@chenglou/pretext": "^0.0.6",
"@dnd-kit/abstract": "^0.4.0",
"@dnd-kit/collision": "^0.4.0",
Expand Down
74 changes: 37 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ nodeLinker: hoisted

minimumReleaseAgeExclude:
- electron@41.7.0
- "@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.154"
- "@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.154"
- "@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.154"
- "@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.154"
- "@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.154"
- "@anthropic-ai/claude-agent-sdk-linux-x64@0.3.154"
- "@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.154"
- "@anthropic-ai/claude-agent-sdk-win32-x64@0.3.154"
- "@anthropic-ai/claude-agent-sdk@0.3.154"
- "@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.170"
- "@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.170"
- "@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.170"
- "@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.170"
- "@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.170"
- "@anthropic-ai/claude-agent-sdk-linux-x64@0.3.170"
- "@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.170"
- "@anthropic-ai/claude-agent-sdk-win32-x64@0.3.170"
- "@anthropic-ai/claude-agent-sdk@0.3.170"
# Already present in the lockfile when the supply-chain guard was added.
- "react@19.2.7"
- "react-dom@19.2.7"
Expand Down
71 changes: 71 additions & 0 deletions src/renderer/components/providers/claude/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { describe, expect, it } from "vitest";
import type { AgentCapability } from "@/shared/contracts";
import { getComposerControls } from "../ProviderIcon";
import type { ComposerControl } from "@/renderer/components/thread/ThreadComposer";
import "./index";

const capabilities = {
models: [
{ id: "claude-fable-5", label: "Fable 5" },
{ id: "haiku", label: "Haiku" },
],
efforts: ["low", "medium", "high", "xHigh", "max", "ultracode"],
defaultEffort: "high",
modelEfforts: {
"claude-fable-5": ["low", "medium", "high", "xHigh", "max", "ultracode"],
haiku: [],
},
modes: ["agent", "plan"],
approvalPolicies: [
{ id: "default", label: "Default" },
{ id: "auto", label: "Auto mode" },
{ id: "bypassPermissions", label: "Bypass Permissions" },
],
sandboxModes: [],
supportsResume: true,
supportsDirectInput: true,
liveInputMode: "terminal",
presentationMode: "terminal",
settingDefs: [],
} as AgentCapability;

function isPermissionControl(
control: ComposerControl,
): control is ComposerControl & { iconKind: "permission" } {
return "iconKind" in control && control.iconKind === "permission";
}

describe("Claude composer controls", () => {
it("allows auto permissions for Fable 5", () => {
const controls = getComposerControls("claude")?.({
capabilities,
config: { model: "claude-fable-5" },
isDisabled: false,
onConfigChange: () => undefined,
});

const permission = controls?.find(isPermissionControl);
expect(permission && "options" in permission ? permission.options : []).toContainEqual({
id: "auto",
label: "Auto mode",
});
});

it("filters auto permissions for Haiku", () => {
const controls = getComposerControls("claude")?.({
capabilities,
config: { model: "haiku", approvalPolicy: "auto" },
isDisabled: false,
onConfigChange: () => undefined,
});

const permission = controls?.find(isPermissionControl);
expect(permission && "options" in permission ? permission.options : []).not.toContainEqual({
id: "auto",
label: "Auto mode",
});
expect(permission && "value" in permission ? permission.value : undefined).toBe(
"bypassPermissions",
);
});
});
18 changes: 10 additions & 8 deletions src/renderer/components/providers/claude/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ registerConflictResolverDefaults("claude", {
effort: "high",
});

// Auto mode is only supported for Sonnet 4.6+ and Opus 4.6+.
// Filter it out for Haiku and other models that don't support it.
const AUTO_CAPABLE_MODELS = new Set([
"sonnet",
"claude-fable-5",
"claude-opus-4-6",
"claude-opus-4-7",
"claude-opus-4-8",
]);

registerComposerControls("claude", ({ capabilities, config, isDisabled, onConfigChange }) => {
const isPlanMode = (config.mode ?? "agent") !== "agent";

// Auto mode is only supported for Sonnet 4.6+ and Opus 4.6+.
// Filter it out for Haiku and other models that don't support it.
const AUTO_CAPABLE_MODELS = new Set([
"sonnet",
"claude-opus-4-6",
"claude-opus-4-7",
"claude-opus-4-8",
]);
const modelSupportsAuto = !config.model || AUTO_CAPABLE_MODELS.has(config.model);
const filteredPolicies = modelSupportsAuto
? capabilities.approvalPolicies
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/providers/triggerWords.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function words(kind: string | undefined, model: string | undefined): string[] {
describe("getTriggerWords", () => {
it("leaves workflow as plain text for Claude models", () => {
expect(words("claude", "claude-opus-4-8")).toEqual([]);
expect(words("claude", "claude-fable-5")).toEqual([]);
expect(words("claude", "claude-opus-4-7")).toEqual([]);
expect(words("claude", "claude-opus-4-6")).toEqual([]);
expect(words("claude", "sonnet")).toEqual([]);
Expand Down
22 changes: 21 additions & 1 deletion src/supervisor/agents/claude/claude.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { createClaudeAdapter } from "./index";
import { parseClaudeAuthStatusJson } from "./detection";
import { claudeCapabilities, parseClaudeAuthStatusJson } from "./detection";
import type { OscNotification, OscTitle } from "@/shared/osc";
import type { ProjectLocation, ThreadConfig } from "@/shared/contracts";

Expand Down Expand Up @@ -131,6 +131,26 @@ describe("createClaudeAdapter structured sessions", () => {
});
});

describe("claudeCapabilities", () => {
it("advertises Fable 5 as a 1M-only non-fast model guarded by the probe", () => {
expect(claudeCapabilities.models).toContainEqual({ id: "claude-fable-5", label: "Fable 5" });
expect(claudeCapabilities.modelEfforts["claude-fable-5"]).toEqual([
"low",
"medium",
"high",
"xHigh",
"max",
"ultracode",
]);
expect(claudeCapabilities.modelContextSizes?.["claude-fable-5"]).toEqual(["1m"]);
expect(claudeCapabilities.fastModels).not.toContain("claude-fable-5");
});

it("lists Fable 5 first so the latest model is the default for new threads", () => {
expect(claudeCapabilities.models[0]).toEqual({ id: "claude-fable-5", label: "Fable 5" });
});
});

describe("createClaudeAdapter buildAcpLogoutCommand", () => {
it("returns `claude auth logout` so the Settings logout button can drive it", async () => {
const adapter = createClaudeAdapter();
Expand Down
12 changes: 9 additions & 3 deletions src/supervisor/agents/claude/detection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,24 @@ const CLAUDE_BUILT_IN_SLASH_COMMANDS: AgentCapability["slashCommands"] = [
},
];

/** Effort tiers shared by the frontier models (Opus 4.7/4.8 and Fable 5). */
const PREMIUM_EFFORT_TIERS = ["low", "medium", "high", "xHigh", "max", "ultracode"];

export const claudeCapabilities: AgentCapability = {
models: [
{ id: "claude-fable-5", label: "Fable 5" },
{ id: "claude-opus-4-8", label: "Opus 4.8" },
{ id: "claude-opus-4-7", label: "Opus 4.7" },
{ id: "claude-opus-4-6", label: "Opus 4.6" },
{ id: "sonnet", label: "Sonnet" },
{ id: "haiku", label: "Haiku" },
],
efforts: ["low", "medium", "high", "xHigh", "max", "ultracode"],
efforts: PREMIUM_EFFORT_TIERS,
defaultEffort: "high",
modelEfforts: {
"claude-opus-4-8": ["low", "medium", "high", "xHigh", "max", "ultracode"],
"claude-opus-4-7": ["low", "medium", "high", "xHigh", "max", "ultracode"],
"claude-fable-5": PREMIUM_EFFORT_TIERS,
"claude-opus-4-8": PREMIUM_EFFORT_TIERS,
"claude-opus-4-7": PREMIUM_EFFORT_TIERS,
"claude-opus-4-6": ["low", "medium", "high", "max"],
haiku: [],
sonnet: ["low", "medium", "high", "max"],
Expand All @@ -45,6 +50,7 @@ export const claudeCapabilities: AgentCapability = {
// to 1M (the long-context build users select these for); Sonnet defaults to
// 200k because the 1M tier is billed per-token at premium rates.
modelContextSizes: {
"claude-fable-5": ["1m"],
"claude-opus-4-8": ["1m", "200k"],
"claude-opus-4-7": ["1m", "200k"],
"claude-opus-4-6": ["1m", "200k"],
Expand Down
Loading