fix: prevent blank screen when clearing Capabilities field
The MarkdownEditor in the agent Configuration tab crashes when the Capabilities field is fully cleared. The onChange handler converts empty strings to null via (v || null), but the eff() overlay function then returns that null to MDXEditor which expects a string, causing an unhandled React crash and a blank screen. Add a null-coalescing fallback (?? "") so MDXEditor always receives a string. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c610192c53
commit
c424f06263
|
|
@ -515,7 +515,7 @@ export function AgentConfigForm(props: AgentConfigFormProps) {
|
|||
</Field>
|
||||
<Field label="Capabilities" hint={help.capabilities}>
|
||||
<MarkdownEditor
|
||||
value={eff("identity", "capabilities", props.agent.capabilities ?? "")}
|
||||
value={eff("identity", "capabilities", props.agent.capabilities ?? "") ?? ""}
|
||||
onChange={(v) => mark("identity", "capabilities", v || null)}
|
||||
placeholder="Describe what this agent can do..."
|
||||
contentClassName="min-h-[44px] text-sm font-mono"
|
||||
|
|
|
|||
Loading…
Reference in New Issue