fix(openai): clarify remote Codex OAuth prompt · openclaw/openclaw@8354977
rubencu
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -278,7 +278,8 @@ export async function loginOpenAICodexOAuth(params: {
|
278 | 278 | ? [ |
279 | 279 | "You are running in a remote/VPS environment.", |
280 | 280 | "A URL will be shown for you to open in your LOCAL browser.", |
281 | | -"After signing in, paste the redirect URL back here.", |
| 281 | +"Open it, sign in, then paste the redirect URL here.", |
| 282 | +"If this OpenClaw process can receive the browser callback, sign-in may finish automatically before you paste.", |
282 | 283 | ].join("\n") |
283 | 284 | : [ |
284 | 285 | "Browser will open for OpenAI authentication.", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -212,6 +212,24 @@ describe("loginOpenAICodexOAuth", () => {
|
212 | 212 | ); |
213 | 213 | }); |
214 | 214 | |
| 215 | +it("describes remote OAuth paste first while noting automatic callback completion", async () => { |
| 216 | +const creds = createCodexCredentials(); |
| 217 | +mocks.loginOpenAICodex.mockResolvedValue(creds); |
| 218 | + |
| 219 | +const { prompter } = await runCodexOAuth({ isRemote: true }); |
| 220 | +const noteCalls = (prompter.note as unknown as { mock?: { calls?: Array<Array<unknown>> } }) |
| 221 | +.mock?.calls; |
| 222 | +const [message, title] = noteCalls?.[0] ?? []; |
| 223 | + |
| 224 | +expect(title).toBe("OpenAI Codex OAuth"); |
| 225 | +expect(message).toContain("A URL will be shown for you to open in your LOCAL browser."); |
| 226 | +expect(message).toContain("Open it, sign in, then paste the redirect URL here."); |
| 227 | +expect(message).toContain( |
| 228 | +"If this OpenClaw process can receive the browser callback, sign-in may finish automatically before you paste.", |
| 229 | +); |
| 230 | +expect(message).not.toContain("After signing in, paste"); |
| 231 | +}); |
| 232 | + |
215 | 233 | it("explains OpenAI unsupported region token exchange failures", async () => { |
216 | 234 | mocks.loginOpenAICodex.mockRejectedValue(new Error("403 unsupported_country_region_territory")); |
217 | 235 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -166,7 +166,8 @@ export async function loginOpenAICodexOAuth(params: {
|
166 | 166 | ? [ |
167 | 167 | "You are running in a remote/VPS environment.", |
168 | 168 | "A URL will be shown for you to open in your LOCAL browser.", |
169 | | -"After signing in, paste the redirect URL back here.", |
| 169 | +"Open it, sign in, then paste the redirect URL here.", |
| 170 | +"If this OpenClaw process can receive the browser callback, sign-in may finish automatically before you paste.", |
170 | 171 | ].join("\n") |
171 | 172 | : [ |
172 | 173 | "Browser will open for OpenAI authentication.", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。