mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 15:10:43 +00:00
Fix setup TUI hatch terminal handoff (#69524)
* fix: relaunch setup tui in a fresh process
* fix: harden setup tui handoff
* fix: preserve tui hatch exit flow
* Revert "fix: preserve tui hatch exit flow"
This reverts commit f4f119a5a3.
* fix: let setup tui resolve gateway auth
* fix: support packaged tui relaunch
* fix: pin setup tui gateway target
* fix: preserve setup tui auth source
This commit is contained in:
@@ -30,7 +30,7 @@ import { ensureControlUiAssetsBuilt } from "../infra/control-ui-assets.js";
|
||||
import { formatErrorMessage } from "../infra/errors.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { restoreTerminalState } from "../terminal/restore.js";
|
||||
import { runTui } from "../tui/tui.js";
|
||||
import { launchTuiCli } from "../tui/tui-launch.js";
|
||||
import { resolveUserPath } from "../utils.js";
|
||||
import { listConfiguredWebSearchProviders } from "../web-search/runtime.js";
|
||||
import type { WizardPrompter } from "./prompts.js";
|
||||
@@ -423,14 +423,21 @@ export async function finalizeSetupWizard(
|
||||
|
||||
if (hatchChoice === "tui") {
|
||||
restoreTerminalState("pre-setup tui", { resumeStdinIfPaused: true });
|
||||
await runTui({
|
||||
url: links.wsUrl,
|
||||
token: settings.authMode === "token" ? settings.gatewayToken : undefined,
|
||||
password: settings.authMode === "password" ? resolvedGatewayPassword : "",
|
||||
// Safety: setup TUI should not auto-deliver to lastProvider/lastTo.
|
||||
deliver: false,
|
||||
message: hasBootstrap ? "Wake up, my friend!" : undefined,
|
||||
});
|
||||
try {
|
||||
await launchTuiCli(
|
||||
{
|
||||
// Safety: setup TUI should not auto-deliver to lastProvider/lastTo.
|
||||
deliver: false,
|
||||
message: hasBootstrap ? "Wake up, my friend!" : undefined,
|
||||
},
|
||||
{
|
||||
authSource: "config",
|
||||
gatewayUrl: links.wsUrl,
|
||||
},
|
||||
);
|
||||
} finally {
|
||||
restoreTerminalState("post-setup tui", { resumeStdinIfPaused: true });
|
||||
}
|
||||
launchedTui = true;
|
||||
} else if (hatchChoice === "web") {
|
||||
const browserSupport = await detectBrowserOpenSupport();
|
||||
|
||||
Reference in New Issue
Block a user