diff --git a/ui-tui/src/app/useInputHandlers.ts b/ui-tui/src/app/useInputHandlers.ts index 211eb8396..72cd5b9e5 100644 --- a/ui-tui/src/app/useInputHandlers.ts +++ b/ui-tui/src/app/useInputHandlers.ts @@ -384,10 +384,21 @@ export function useInputHandlers(ctx: InputHandlerContext): InputHandlerResult { return void actions.sys('yolo needs an active session') } - return void gateway - .rpc('config.set', { key: 'yolo', session_id: live.sid }) - .then(r => actions.sys(r?.value === '1' ? 'yolo on' : r?.value === '0' ? 'yolo off' : 'failed to toggle yolo')) - .catch(() => actions.sys('failed to toggle yolo')) + // gateway.rpc swallows errors with its own sys() message and resolves to null, + // so we only speak when it came back with a real shape. null = rpc already spoke. + return void gateway.rpc('config.set', { key: 'yolo', session_id: live.sid }).then(r => { + if (r?.value === '1') { + return actions.sys('yolo on') + } + + if (r?.value === '0') { + return actions.sys('yolo off') + } + + if (r) { + actions.sys('failed to toggle yolo') + } + }) } if (key.tab && cState.completions.length) { diff --git a/ui-tui/src/components/appLayout.tsx b/ui-tui/src/components/appLayout.tsx index c96960ac8..cdac992d3 100644 --- a/ui-tui/src/components/appLayout.tsx +++ b/ui-tui/src/components/appLayout.tsx @@ -173,12 +173,14 @@ const ComposerPane = memo(function ComposerPane({ )} - {status.showStickyPrompt && ( + {status.showStickyPrompt ? ( {status.stickyPrompt} + ) : ( + )}