dispatchrun / dispatch

Entrypoint of the Dispatch ecosystem.
11 stars 1 forks source link

Fix headless mode #37

Closed chriso closed 4 months ago

chriso commented 4 months ago

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.