fix(app): make prompt input agent toggle reactive (#38653)

This commit is contained in:
Brendan Allan 2026-07-24 16:12:57 +08:00 committed by GitHub
commit ce7f54d5e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -447,15 +447,16 @@ export function usePromptInputV2Controller(props: PromptInputV2ControllerProps):
}, },
view: { view: {
placeholder: designPlaceholder, placeholder: designPlaceholder,
agent: get agent() {
props.controls.agents.visible && props.controls.agents.options.length > 0 return props.controls.agents.visible && props.controls.agents.options.length > 0
? { ? {
options: () => props.controls.agents.options.map((name) => ({ id: name, label: name })), options: () => props.controls.agents.options.map((name) => ({ id: name, label: name })),
current: () => props.controls.agents.current, current: () => props.controls.agents.current,
onSelect: props.controls.agents.select, onSelect: (value: string) => props.controls.agents.select(value),
keybind: () => command.keybindParts("agent.cycle"), keybind: () => command.keybindParts("agent.cycle"),
} }
: undefined, : undefined
},
variant: { variant: {
options: () => variants().map((value) => ({ id: value, label: value })), options: () => variants().map((value) => ({ id: value, label: value })),
current: () => props.controls.model.selection.variant.current() ?? "default", current: () => props.controls.model.selection.variant.current() ?? "default",