fix: More fixes, yay! (#632)

* fix: More fixes, yay!

* cr
This commit is contained in:
Brace Sproul 2025-08-01 10:44:51 -07:00 • committed by GitHub
parent 65b700e698
commit 2b0ede964c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 62 additions and 23 deletions

View file

@ -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:
<required_scripts>
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.
</required_scripts>
<changed_files>

View file

@ -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,
},
};

View file

@ -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 (
<div className="space-y-8">
<Alert className="border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-900/20">
<Info className="h-4 w-4 text-blue-600 dark:text-blue-400" />
<AlertDescription className="text-blue-800 dark:text-blue-300">
Open SWE uses Anthropic models by default. Configure your Anthropic
API key below to get started.
</AlertDescription>
</Alert>
{Object.entries(apiKeySections).map(([sectionKey, section]) => (
<Card
key={sectionKey}

View file

@ -9,7 +9,8 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
import { Settings } from "lucide-react";
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Settings, AlertTriangle } from "lucide-react";
import { ConfigField } from "@/components/configuration/config-field";
import { useConfigStore, DEFAULT_CONFIG_KEY } from "@/hooks/useConfigStore";
import { Skeleton } from "@/components/ui/skeleton";
@ -62,20 +63,24 @@ export function ConfigManager() {
// TODO: If we implement a concept of users and start storing config on assistants,
// we will need to update this to fetch configs from the assistant first.
setLoading(true);
setDefaultConfig(extractConfigurationsFromSchema({}));
if (getConfig(DEFAULT_CONFIG_KEY)) {
const actualConfigs = extractConfigurationsFromSchema(
getConfig(DEFAULT_CONFIG_KEY),
);
setConfigurations(actualConfigs);
setLoading(false);
return;
}
const actualConfigs = extractConfigurationsFromSchema({});
actualConfigs.forEach((c) => {
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 (
<div className="space-y-8">
<Alert className="border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-400">
<AlertTriangle className="h-4 w-4" />
<AlertDescription>
<strong>Warning:</strong> 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.
</AlertDescription>
</Alert>
<Card className="bg-card border-border shadow-sm">
<CardHeader>
<div className="flex items-center justify-between">
@ -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() {
<Button
size="sm"
variant="outline"
onClick={() =>
onClick={() => {
// Remove the config value to revert to default
// This effectively "unsets" the user's custom value
const existingConfig =
getConfig(DEFAULT_CONFIG_KEY) || {};
const {
[config.label]: _,
...remainingConfig
} = existingConfig;
updateConfig(
DEFAULT_CONFIG_KEY,
config.label,
defaultValue,
)
}
"",
remainingConfig,
);
}}
>
Reset to Default
</Button>