mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
fix(openai): clarify remote Codex OAuth prompt
This commit is contained in:
committed by
Peter Steinberger
parent
48fb4bade8
commit
83549774cd
@@ -278,7 +278,8 @@ export async function loginOpenAICodexOAuth(params: {
|
||||
? [
|
||||
"You are running in a remote/VPS environment.",
|
||||
"A URL will be shown for you to open in your LOCAL browser.",
|
||||
"After signing in, paste the redirect URL back here.",
|
||||
"Open it, sign in, then paste the redirect URL here.",
|
||||
"If this OpenClaw process can receive the browser callback, sign-in may finish automatically before you paste.",
|
||||
].join("\n")
|
||||
: [
|
||||
"Browser will open for OpenAI authentication.",
|
||||
|
||||
@@ -212,6 +212,24 @@ describe("loginOpenAICodexOAuth", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("describes remote OAuth paste first while noting automatic callback completion", async () => {
|
||||
const creds = createCodexCredentials();
|
||||
mocks.loginOpenAICodex.mockResolvedValue(creds);
|
||||
|
||||
const { prompter } = await runCodexOAuth({ isRemote: true });
|
||||
const noteCalls = (prompter.note as unknown as { mock?: { calls?: Array<Array<unknown>> } })
|
||||
.mock?.calls;
|
||||
const [message, title] = noteCalls?.[0] ?? [];
|
||||
|
||||
expect(title).toBe("OpenAI Codex OAuth");
|
||||
expect(message).toContain("A URL will be shown for you to open in your LOCAL browser.");
|
||||
expect(message).toContain("Open it, sign in, then paste the redirect URL here.");
|
||||
expect(message).toContain(
|
||||
"If this OpenClaw process can receive the browser callback, sign-in may finish automatically before you paste.",
|
||||
);
|
||||
expect(message).not.toContain("After signing in, paste");
|
||||
});
|
||||
|
||||
it("explains OpenAI unsupported region token exchange failures", async () => {
|
||||
mocks.loginOpenAICodex.mockRejectedValue(new Error("403 unsupported_country_region_territory"));
|
||||
|
||||
|
||||
@@ -166,7 +166,8 @@ export async function loginOpenAICodexOAuth(params: {
|
||||
? [
|
||||
"You are running in a remote/VPS environment.",
|
||||
"A URL will be shown for you to open in your LOCAL browser.",
|
||||
"After signing in, paste the redirect URL back here.",
|
||||
"Open it, sign in, then paste the redirect URL here.",
|
||||
"If this OpenClaw process can receive the browser callback, sign-in may finish automatically before you paste.",
|
||||
].join("\n")
|
||||
: [
|
||||
"Browser will open for OpenAI authentication.",
|
||||
|
||||
Reference in New Issue
Block a user