fix(anthropic): prefer claude cli over setup-token

This commit is contained in:
Peter Steinberger
2026-04-06 15:30:49 +01:00
parent b535d1e2b9
commit ac38f332c5
14 changed files with 33 additions and 27 deletions

View File

@@ -579,7 +579,7 @@ describe("modelsAuthLoginCommand", () => {
});
});
it("writes pasted Anthropic setup-tokens and logs the legacy warning", async () => {
it("writes pasted Anthropic setup-tokens and logs the preference note", async () => {
const runtime = createRuntime();
mocks.clackText.mockResolvedValue(`sk-ant-oat01-${"a".repeat(80)}`);
@@ -595,7 +595,10 @@ describe("modelsAuthLoginCommand", () => {
agentDir: "/tmp/openclaw/agents/main",
});
expect(runtime.log).toHaveBeenCalledWith(
"Anthropic setup-token auth is a legacy/manual path in OpenClaw.",
"Anthropic setup-token auth is supported in OpenClaw.",
);
expect(runtime.log).toHaveBeenCalledWith(
"OpenClaw prefers Claude CLI reuse when it is available on the host.",
);
expect(runtime.log).toHaveBeenCalledWith(
"Anthropic staff told us this OpenClaw path is allowed again.",

View File

@@ -420,7 +420,8 @@ export async function modelsAuthPasteTokenCommand(
logConfigUpdated(runtime);
runtime.log(`Auth profile: ${profileId} (${provider}/token)`);
if (provider === "anthropic") {
runtime.log("Anthropic setup-token auth is a legacy/manual path in OpenClaw.");
runtime.log("Anthropic setup-token auth is supported in OpenClaw.");
runtime.log("OpenClaw prefers Claude CLI reuse when it is available on the host.");
runtime.log("Anthropic staff told us this OpenClaw path is allowed again.");
}
}