fix(openclaw): address code review findings for robustness

- Fix EnvPanel visibleKeys using entry key name instead of array index
  to prevent visibility state corruption after deletion
- Add NaN guard in AgentsDefaultsPanel numeric field parsing
- Validate provider id and models before importing from live config
- Upgrade import failure log level from debug to warn for OpenCode/OpenClaw
This commit is contained in:
Jason
2026-02-08 11:14:46 +08:00
parent eccb95b83d
commit bc87f9d9eb
4 changed files with 30 additions and 8 deletions
+3 -2
View File
@@ -112,7 +112,8 @@ const EnvPanel: React.FC = () => {
<div className="space-y-3">
{entries.map((entry, index) => {
const sensitive = isApiKey(entry.key);
const visible = visibleKeys.has(`${index}`);
const visibilityId = entry.key || `__new_${index}`;
const visible = visibleKeys.has(visibilityId);
return (
<div key={index} className="flex items-center gap-2">
@@ -138,7 +139,7 @@ const EnvPanel: React.FC = () => {
variant="ghost"
size="icon"
className="flex-shrink-0 h-9 w-9 text-muted-foreground"
onClick={() => toggleVisibility(`${index}`)}
onClick={() => toggleVisibility(visibilityId)}
>
{visible ? (
<EyeOff className="w-4 h-4" />