When starting TUI, the `directory` parameter is not passed to the `tui()` function, which causes session loading to fail in certain scenarios. The fix is straightforward - pass the `cwd` variable to `tui()` in `thread.ts`.