From 2b0ede964c27e9f0f627f0f1d3cac4c9a985befa Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Fri, 1 Aug 2025 10:44:51 -0700 Subject: [PATCH] fix: More fixes, yay! (#632) * fix: More fixes, yay! * cr --- .../nodes/generate-review-actions/prompt.ts | 4 +- apps/open-swe/src/utils/llms/constants.ts | 2 +- .../src/features/settings-page/api-keys.tsx | 10 ++- .../features/settings-page/config-manager.tsx | 69 +++++++++++++------ 4 files changed, 62 insertions(+), 23 deletions(-) diff --git a/apps/open-swe/src/graphs/reviewer/nodes/generate-review-actions/prompt.ts b/apps/open-swe/src/graphs/reviewer/nodes/generate-review-actions/prompt.ts index b623d689..f5ea8382 100644 --- a/apps/open-swe/src/graphs/reviewer/nodes/generate-review-actions/prompt.ts +++ b/apps/open-swe/src/graphs/reviewer/nodes/generate-review-actions/prompt.ts @@ -60,8 +60,10 @@ By reviewing these actions, and comparing them to the plan and original user req When reviewing the changes, you should perform these actions in order: - Search for any scripts which are required for the pull request to pass CI. This may include unit tests (you do not have access to environment variables, and thus can not run integration tests), linters, formatters, etc. + Search for any scripts which are required for the pull request to pass CI. This may include unit tests (you do not have access to environment variables, and thus can not run integration tests), linters, formatters, build, etc. Once you find these, ensure you write to your scratchpad to record the names of the scripts, how to invoke them, and any other relevant context required to run them. + For example: Many JavaScript/TypeScript projects have lint, test, format, and build scripts. Python projects may have lint, test, format, and typecheck scripts. + It is vital that you ALWAYS find these scripts, and run them to ensure your code always meets the quality standards of the codebase. diff --git a/apps/open-swe/src/utils/llms/constants.ts b/apps/open-swe/src/utils/llms/constants.ts index e8f7e138..f28e79c5 100644 --- a/apps/open-swe/src/utils/llms/constants.ts +++ b/apps/open-swe/src/utils/llms/constants.ts @@ -45,7 +45,7 @@ export const TASK_TO_CONFIG_DEFAULTS_MAP = { temperature: 0, }, [Task.SUMMARIZER]: { - modelName: "openai:gpt-4.1-mini", + modelName: "anthropic:claude-3-5-haiku-latest", temperature: 0, }, }; diff --git a/apps/web/src/features/settings-page/api-keys.tsx b/apps/web/src/features/settings-page/api-keys.tsx index 5ea5f63f..edff5078 100644 --- a/apps/web/src/features/settings-page/api-keys.tsx +++ b/apps/web/src/features/settings-page/api-keys.tsx @@ -8,7 +8,8 @@ import { CardTitle, } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; -import { Eye, EyeOff, Key, Trash2 } from "lucide-react"; +import { Alert, AlertDescription } from "@/components/ui/alert"; +import { Eye, EyeOff, Key, Trash2, Info } from "lucide-react"; import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import { cn } from "@/lib/utils"; @@ -106,6 +107,13 @@ export function APIKeysTab() { return (
+ + + + Open SWE uses Anthropic models by default. Configure your Anthropic + API key below to get started. + + {Object.entries(apiKeySections).map(([sectionKey, section]) => ( { - updateConfig(DEFAULT_CONFIG_KEY, c.label, c.default); - }); + // Extract default configurations from schema + const defaultConfigs = extractConfigurationsFromSchema({}); + setDefaultConfig(defaultConfigs); + + // Get existing user configurations (if any) + const existingConfig = getConfig(DEFAULT_CONFIG_KEY) || {}; + + // Create configurations array with user values where they exist, defaults otherwise + const actualConfigs = defaultConfigs.map((config) => ({ + ...config, + // Use existing user value if it exists, otherwise keep the default for display + default: + existingConfig[config.label] !== undefined + ? existingConfig[config.label] + : config.default, + })); + setConfigurations(actualConfigs); setLoading(false); }; @@ -89,11 +94,21 @@ export function ConfigManager() { const defaultValue = defaultConfig.find( (c) => c.label === config.label, )?.default; + // Only consider it configured if the user has explicitly set a value return currentValue !== undefined && currentValue !== defaultValue; }); return (
+ + + + Warning: The default configuration values have been + carefully selected for optimal performance. Modifying these settings + may negatively impact the agent's performance and behavior. Only + change these values if you understand their implications. + +
@@ -182,8 +197,14 @@ export function ConfigManager() { min={config.min} max={config.max} step={config.step} - value={configs[DEFAULT_CONFIG_KEY]?.[config.label]} + value={ + configs[DEFAULT_CONFIG_KEY]?.[config.label] !== + undefined + ? configs[DEFAULT_CONFIG_KEY][config.label] + : config.default + } setValue={(value) => { + // Only store in config when user actually changes a value updateConfig(DEFAULT_CONFIG_KEY, config.label, value); }} /> @@ -204,13 +225,21 @@ export function ConfigManager() {