mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 07:12:12 +03:00
fix: complete bugfixes for UI, OAuth fallbacks, cliRuntime Windows constraints and Codex non-streaming integration
This commit is contained in:
@@ -211,6 +211,8 @@ export default function OAuthModal({
|
||||
return;
|
||||
}
|
||||
|
||||
let forceManual = false;
|
||||
|
||||
// Codex: on localhost use callback server on port 1455,
|
||||
// on remote use standard auth code flow (callback server is unreachable)
|
||||
if (provider === "codex") {
|
||||
@@ -252,11 +254,13 @@ export default function OAuthModal({
|
||||
setPolling(false);
|
||||
throw new Error("Authorization timeout");
|
||||
} catch (codexErr) {
|
||||
console.warn(
|
||||
"Codex callback server failed, falling back to standard manual flow",
|
||||
codexErr
|
||||
);
|
||||
setPolling(false);
|
||||
setStep("input");
|
||||
setError(codexErr.message + " — You can paste the callback URL manually below.");
|
||||
forceManual = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Remote: fall through to standard auth code flow below
|
||||
}
|
||||
@@ -306,8 +310,8 @@ export default function OAuthModal({
|
||||
|
||||
setAuthData({ ...data, redirectUri });
|
||||
|
||||
// For non-true-localhost (LAN IPs, remote): use manual input mode (user pastes callback URL)
|
||||
if (!isTrueLocalhost) {
|
||||
// For non-true-localhost (LAN IPs, remote) or manual fallback: use manual input mode (user pastes callback URL)
|
||||
if (!isTrueLocalhost || forceManual) {
|
||||
setStep("input");
|
||||
window.open(data.authUrl, "oauth_auth");
|
||||
} else {
|
||||
|
||||
@@ -328,10 +328,7 @@ const getExpectedParentPaths = (): string[] => {
|
||||
const npmPrefix = getNpmGlobalPrefix();
|
||||
|
||||
// Add common user bin directories
|
||||
const userBinPaths = [
|
||||
path.join(home, "bin"),
|
||||
path.join(home, ".local", "bin"),
|
||||
];
|
||||
const userBinPaths = [path.join(home, "bin"), path.join(home, ".local", "bin")];
|
||||
|
||||
return [
|
||||
home,
|
||||
@@ -531,11 +528,15 @@ const locateCommand = async (command: string, env: Record<string, string | undef
|
||||
if (!located.ok || !located.stdout) {
|
||||
return { installed: false, commandPath: null, reason: "not_found" };
|
||||
}
|
||||
const first =
|
||||
located.stdout
|
||||
.split(/\r?\n/)
|
||||
.map((line) => normalizeMsys2Path(line.trim()))
|
||||
.find(Boolean) || null;
|
||||
const lines = located.stdout
|
||||
.split(/\r?\n/)
|
||||
.map((line) => normalizeMsys2Path(line.trim()))
|
||||
.filter(Boolean);
|
||||
|
||||
// Issue #809: Prioritize executable wrappers (.cmd, .exe, .bat) over extensionless bash scripts
|
||||
// that NPM often drops alongside the wrappers in global installs.
|
||||
const first = lines.find((line) => /\.(cmd|exe|bat)$/i.test(line)) || lines[0] || null;
|
||||
|
||||
return { installed: !!first, commandPath: first, reason: first ? null : "not_found" };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user