mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-06 05:56:19 +01:00
feat: default Claude to the native runner on Apple Silicon
Carry Claude effort through versioned native admission and recovery. Preserve existing connections and saved runner choices, and price Opus 5.5 API receipts. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
058af8f1b6
commit
6fd56c445d
77 files changed
+909
-296
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { useMemo, useState } from "react";
|
||||
import { agentHarnessType, agentRunner, type AgentRunnerChoice } from "@paperclipai/shared";
|
||||
import { adaptersApi } from "@/api/adapters";
|
||||
import { CodexRunnerSelect } from "./CodexRunnerSelect";
|
||||
import { AgentRunnerSelect } from "./AgentRunnerSelect";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import {
|
||||
@@ -68,12 +68,12 @@ export function ConfigureBuiltInAgentModal({
|
||||
const { definition } = state;
|
||||
|
||||
const [adapterType, setAdapterType] = useState<string>(
|
||||
() => state.agent && agentHarnessType(state.agent.adapterType, state.agent.adapterConfig) === "codex_local" ? "codex_local" : state.agent?.adapterType ?? defaultAdapterType(state),
|
||||
() => state.agent && ["codex_local", "claude_local"].includes(agentHarnessType(state.agent.adapterType, state.agent.adapterConfig)) ? agentHarnessType(state.agent.adapterType, state.agent.adapterConfig) : state.agent?.adapterType ?? defaultAdapterType(state),
|
||||
);
|
||||
const [runner, setRunner] = useState<AgentRunnerChoice | undefined>();
|
||||
const environmentId = state.agent?.defaultEnvironmentId ?? null;
|
||||
const adapters = useQuery({ queryKey: queryKeys.adapters.availability(companyId, environmentId), queryFn: () => adaptersApi.list({ companyId, environmentId }), enabled: open });
|
||||
const codexAvailability = adapters.data?.find(item => item.type === "codex_local");
|
||||
const runnerAvailability = adapters.data?.find(item => item.type === adapterType);
|
||||
const [model, setModel] = useState<string>(() => {
|
||||
const config = state.agent?.adapterConfig;
|
||||
const configuredModel = typeof config === "object" && config !== null
|
||||
@@ -145,7 +145,7 @@ export function ConfigureBuiltInAgentModal({
|
||||
: { adapterType, adapterConfig };
|
||||
const result = await builtInAgentsApi.provision(companyId, definition.key, {
|
||||
...adapterInput,
|
||||
...(adapterType === "codex_local" && runner !== undefined ? { runner } : {}),
|
||||
...(["codex_local", "claude_local"].includes(adapterType) && runner !== undefined ? { runner } : {}),
|
||||
...(budgetMonthlyCents !== undefined ? { budgetMonthlyCents } : {}),
|
||||
});
|
||||
return result;
|
||||
@@ -191,11 +191,11 @@ export function ConfigureBuiltInAgentModal({
|
||||
/>
|
||||
</Field>
|
||||
|
||||
{adapterType === "codex_local" && <details className="space-y-3">
|
||||
{["codex_local", "claude_local"].includes(adapterType) && <details className="space-y-3">
|
||||
<summary className="cursor-pointer text-sm text-muted-foreground">Advanced</summary>
|
||||
<CodexRunnerSelect value={runner ?? (state.agent ? agentRunner(state.agent.adapterType) : "auto")}
|
||||
<AgentRunnerSelect value={runner ?? (state.agent ? agentRunner(state.agent.adapterType) : "auto")}
|
||||
pending={adapters.isFetching} error={adapters.error?.message} onRetry={() => { void adapters.refetch(); }}
|
||||
defaultRunner={codexAvailability?.defaultRunner} supportedRunners={codexAvailability?.supportedRunners}
|
||||
defaultRunner={runnerAvailability?.defaultRunner} supportedRunners={runnerAvailability?.supportedRunners}
|
||||
onChange={setRunner} />
|
||||
</details>}
|
||||
|
||||
|
||||
Reference in new issue
Block a user