mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(tui): address copilot round 3 on #14145
- appLayout.tsx: restore the 1-row placeholder when `showStickyPrompt` is false. Dropping it saved a row but the composer height shifted by one as the prompt appeared/disappeared, jumping the input vertically on scroll. - useInputHandlers: gateway.rpc (from useMainApp) already catches errors with its own sys() message and resolves to null. The previous `.catch` was dead code and on RPC failures the user saw both 'error: ...' (from rpc) and 'failed to toggle yolo'. Drop the catch and gate 'failed to toggle yolo' on a non-null response so null (= rpc already spoke) stays silent.
This commit is contained in:
parent
4107538da8
commit
83efea661f
2 changed files with 18 additions and 5 deletions
|
|
@ -384,10 +384,21 @@ export function useInputHandlers(ctx: InputHandlerContext): InputHandlerResult {
|
|||
return void actions.sys('yolo needs an active session')
|
||||
}
|
||||
|
||||
return void gateway
|
||||
.rpc<ConfigSetResponse>('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<ConfigSetResponse>('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) {
|
||||
|
|
|
|||
|
|
@ -173,12 +173,14 @@ const ComposerPane = memo(function ComposerPane({
|
|||
</Text>
|
||||
)}
|
||||
|
||||
{status.showStickyPrompt && (
|
||||
{status.showStickyPrompt ? (
|
||||
<Text color={ui.theme.color.dim} wrap="truncate-end">
|
||||
<Text color={ui.theme.color.label}>↳ </Text>
|
||||
|
||||
{status.stickyPrompt}
|
||||
</Text>
|
||||
) : (
|
||||
<Text> </Text>
|
||||
)}
|
||||
|
||||
<StatusRulePane at="top" composer={composer} status={status} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue