mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
feat(claude-local): add Bedrock model selection support
Previously, --model was completely skipped for Bedrock users, so the model dropdown selection was silently ignored and the CLI always used its default model. Selecting Haiku would still run Opus. - Add listClaudeModels() that returns Bedrock-native model IDs (us.anthropic.*) when Bedrock env is detected - Register listModels on claude_local adapter so the UI dropdown shows Bedrock models instead of Anthropic API names - Allow --model to pass through when the ID is a Bedrock-native identifier (us.anthropic.* or ARN) - Add isBedrockModelId() helper shared by execute.ts and test.ts Follows up on #2793 which added basic Bedrock auth detection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
aec88f10dd
commit
07987d75ad
5 changed files with 55 additions and 7 deletions
|
|
@ -16,6 +16,7 @@ import {
|
|||
} from "@paperclipai/adapter-utils/server-utils";
|
||||
import path from "node:path";
|
||||
import { detectClaudeLoginRequired, parseClaudeStreamJson } from "./parse.js";
|
||||
import { isBedrockModelId } from "./models.js";
|
||||
|
||||
function summarizeStatus(checks: AdapterEnvironmentCheck[]): AdapterEnvironmentTestResult["status"] {
|
||||
if (checks.some((check) => check.level === "error")) return "fail";
|
||||
|
|
@ -163,10 +164,10 @@ export async function testEnvironment(
|
|||
const args = ["--print", "-", "--output-format", "stream-json", "--verbose"];
|
||||
if (dangerouslySkipPermissions) args.push("--dangerously-skip-permissions");
|
||||
if (chrome) args.push("--chrome");
|
||||
// Skip --model for Bedrock: Anthropic-style model IDs (e.g. "claude-opus-4-6") are not
|
||||
// valid Bedrock model identifiers. Let the CLI use whatever model is configured in its
|
||||
// own settings when Bedrock auth is active.
|
||||
if (model && !hasBedrock) args.push("--model", model);
|
||||
// For Bedrock: only pass --model when the ID is a Bedrock-native identifier.
|
||||
if (model && (!hasBedrock || isBedrockModelId(model))) {
|
||||
args.push("--model", model);
|
||||
}
|
||||
if (effort) args.push("--effort", effort);
|
||||
if (maxTurns > 0) args.push("--max-turns", String(maxTurns));
|
||||
if (extraArgs.length > 0) args.push(...extraArgs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue