mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-09 03:11:58 +00:00
fix(ui-tui): prevent React effect cleanup from killing python TUI gateway subprocess
The useEffect at useMainApp.ts:546-565 calls gw.kill() in its cleanup function. React calls cleanup on every re-render when the dependency array ([gw, sys]) shifts — which happens whenever sys changes identity (any system message). This sends SIGTERM to the Python TUI gateway subprocess, silently killing the backend mid-session. The kill path was already handled by entry.tsx's setupGracefulExit for real app exits (SIGINT, uncaught exception). The die() function also calls gw.kill() for explicit user exit. Removing the cleanup kill leaves all exit paths covered while preventing accidental mid-session kills on ordinary React re-renders.
This commit is contained in:
parent
1a03e3b1c6
commit
660ce7c54b
1 changed files with 1 additions and 1 deletions
|
|
@ -606,10 +606,10 @@ export function useMainApp(gw: GatewayClient) {
|
|||
gw.on('exit', exitHandler)
|
||||
gw.drain()
|
||||
|
||||
// entry.tsx's setupGracefulExit handles process cleanup on real exit.
|
||||
return () => {
|
||||
gw.off('event', handler)
|
||||
gw.off('exit', exitHandler)
|
||||
gw.kill()
|
||||
}
|
||||
}, [gw, sys])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue