This PR contains a few fixes/tweaks to the headless (non-TUI) mode.
Firstly, it fixes a panic that occurs when var tui *TUI is nil. When it's cast to a FunctionCallObserver, the fact that it's nil isn't preserved, causing a panic when if observer != nil { observer.ObserveRequest(...) } is called.
Secondly, I've put the local application in a new process group, so that signals bound for the CLI aren't also received by the local application. This allows the CLI to handle/forward signals correctly, eliminating a race condition that can occur if the child sees the signal first and exits before the CLI has handled the same signal.
Finally, I've made it so that we unconditionally write a prefix before Dispatch and local application logs.
This PR contains a few fixes/tweaks to the headless (non-TUI) mode.
Firstly, it fixes a panic that occurs when
var tui *TUI
is nil. When it's cast to aFunctionCallObserver
, the fact that it'snil
isn't preserved, causing a panic whenif observer != nil { observer.ObserveRequest(...) }
is called.Secondly, I've put the local application in a new process group, so that signals bound for the CLI aren't also received by the local application. This allows the CLI to handle/forward signals correctly, eliminating a race condition that can occur if the child sees the signal first and exits before the CLI has handled the same signal.
Finally, I've made it so that we unconditionally write a prefix before Dispatch and local application logs.