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
4 changes: 2 additions & 2 deletions src/handlers/project/create/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ const HARNESS_ONLY_FLAGS = [
const ModelProviderFlagSchema = z.union([z.literal("Bedrock"), HarnessModelProviderSchema]);
type ModelProviderFlag = z.infer<typeof ModelProviderFlagSchema>;

const HARNESS_DEFAULT_MODEL_IDS: Record<HarnessModelProvider, string> = {
export const HARNESS_DEFAULT_MODEL_IDS: Record<HarnessModelProvider, string> = {
bedrock: DEFAULT_HARNESS_MODEL.modelId,
open_ai: "gpt-5",
gemini: "gemini-2.5-flash",
lite_llm: "anthropic/claude-sonnet-4-5",
lite_llm: `bedrock/${DEFAULT_HARNESS_MODEL.modelId}`,
};

export const createCreateProjectHandler = (config: CreateProjectHandlerConfig) =>
Expand Down
17 changes: 6 additions & 11 deletions src/handlers/project/create/screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import { ProjectNameSchema } from "../../../projectSchemas/project";
import type { HarnessModelProvider } from "../../../projectSchemas/harness";
import type { ScreenProps } from "../../types";
import type { CreateProjectInput } from "../types";
import { DEFAULT_HARNESS_MODEL } from "../add/harness";
import {
resolveRuntimeTemplateShortcut,
type MemoryShortcutName,
type RuntimeTemplateShortcutName,
} from "../shortcuts";
import { resolveScaffoldHarnessInput } from "./index";
import { HARNESS_DEFAULT_MODEL_IDS, resolveScaffoldHarnessInput } from "./index";
import { Layout } from "../../../components/Layout";
import { FormTextInput } from "../../../components/FormTextInput";
import { FormRadioGroup, type FormRadioOption } from "../../../components/FormRadioGroup";
Expand Down Expand Up @@ -50,45 +49,42 @@ interface CreateProjectFormValues {
memory: MemoryShortcutName;
}

// defaultModelId is not declared here: the wizard and the flag path must offer
// the same default, so both read HARNESS_DEFAULT_MODEL_IDS.
const MODEL_PROVIDERS: {
provider: HarnessModelProvider;
label: string;
description: string;
defaultModelId: string;
}[] = [
{
provider: "bedrock",
label: "bedrock (recommended)",
description: "an Amazon Bedrock model or inference profile",
defaultModelId: DEFAULT_HARNESS_MODEL.modelId,
},
{
provider: "open_ai",
label: "openai",
description: "an OpenAI model using an API-key credential ARN",
defaultModelId: "gpt-5",
},
{
provider: "gemini",
label: "gemini",
description: "a Google Gemini model using an API-key credential ARN",
defaultModelId: "gemini-2.5-flash",
},
{
provider: "lite_llm",
label: "litellm",
description: "a third-party provider through LiteLLM",
defaultModelId: "anthropic/claude-sonnet-4-5",
},
];

function emptyProjectModel(): ProjectModelValues {
return {
provider: "bedrock",
configs: Object.fromEntries(
MODEL_PROVIDERS.map(({ provider, defaultModelId }) => [
MODEL_PROVIDERS.map(({ provider }) => [
provider,
{ modelId: defaultModelId, apiKeyArn: "", apiBase: "" },
{ modelId: HARNESS_DEFAULT_MODEL_IDS[provider], apiKeyArn: "", apiBase: "" },
]),
) as Record<HarnessModelProvider, ProjectModelConfig>,
};
Expand Down Expand Up @@ -553,7 +549,6 @@ interface ModelField {
}

function modelFields(provider: HarnessModelProvider): ModelField[] {
const option = MODEL_PROVIDERS.find((candidate) => candidate.provider === provider)!;
const fields: ModelField[] = [
{
key: "modelId",
Expand All @@ -562,7 +557,7 @@ function modelFields(provider: HarnessModelProvider): ModelField[] {
provider === "bedrock"
? "a Bedrock model or inference profile id"
: `the ${providerLabel(provider)} model to use`,
placeholder: option.defaultModelId,
placeholder: HARNESS_DEFAULT_MODEL_IDS[provider],
required: true,
requiredError: `enter a model id for ${providerLabel(provider)}`,
},
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/project/project.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ describe("project create", () => {
).json();
expect(harness.model).toEqual({
provider: "lite_llm",
modelId: "anthropic/claude-sonnet-4-5",
modelId: "bedrock/global.anthropic.claude-sonnet-4-6",
apiBase: "https://litellm.example.com/v1",
additionalParams: { max_retries: 2 },
});
Expand Down
Loading