{"record":{"id":"c85dc5768d84eba0","repo":"can1357/oh-my-pi","slug":"custom-url-is-required-for-option-3","errorCode":null,"errorMessage":"Custom URL is required for option 3","messagePattern":"Custom URL is required for option 3","errorType":"exception","errorClass":"AIError.ConfigurationError","httpStatus":null,"severity":"error","filePath":"packages/ai/src/registry/alibaba-coding-plan.ts","lineNumber":43,"sourceCode":"\t\tthrow new AIError.LoginCancelledError();\n\t}\n\n\tconst choice = endpointChoice.trim();\n\tlet baseUrl: string;\n\tlet authUrl: string;\n\tlet instructions: string;\n\tif (choice === \"2\") {\n\t\tbaseUrl = CHINA_API_BASE_URL;\n\t\tauthUrl = CHINA_AUTH_URL;\n\t\tinstructions = \"Copy your API key from the Alibaba Cloud Bailian console (China mainland)\";\n\t} else if (choice === \"3\") {\n\t\tconst customUrl = await options.onPrompt({\n\t\t\tmessage: \"Enter custom base URL\",\n\t\t\tplaceholder: \"https://your-proxy.com/v1\",\n\t\t});\n\t\tconst trimmedUrl = customUrl.trim().replace(/\\/+$/, \"\");\n\t\tif (!trimmedUrl) {\n\t\t\tthrow new AIError.ConfigurationError(\"Custom URL is required for option 3\");\n\t\t}\n\t\tbaseUrl = trimmedUrl;\n\t\tauthUrl = DEFAULT_AUTH_URL;\n\t\tinstructions = \"Copy your API key from the Alibaba Cloud DashScope console\";\n\t} else {\n\t\tbaseUrl = DEFAULT_API_BASE_URL;\n\t\tauthUrl = DEFAULT_AUTH_URL;\n\t\tinstructions = \"Copy your API key from the Alibaba Cloud DashScope console (International)\";\n\t}\n\n\toptions.onAuth?.({\n\t\turl: authUrl,\n\t\tinstructions,\n\t});\n\n\tconst apiKey = await options.onPrompt({\n\t\tmessage: \"Paste your Alibaba Coding Plan API key\",\n\t\tplaceholder: \"sk-...\",","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/ai/src/registry/alibaba-coding-plan.ts#L25-L61","documentation":"When the user selects endpoint option 3 (Custom) during Alibaba Coding Plan login, the flow prompts for a custom base URL. If the entered URL is empty or only slashes/whitespace after trimming and trailing-slash stripping, a ConfigurationError is thrown because a custom endpoint without a URL cannot be used.","triggerScenarios":"Choosing option 3 at the 'Select Alibaba Coding Plan endpoint' prompt and then pressing Enter (or entering only spaces/slashes) at the 'Enter custom base URL' prompt.","commonSituations":"User selects Custom by mistake instead of option 1 (International); copy-paste failed so the clipboard was empty; terminal swallowed the pasted value.","solutions":["Re-run the login and enter a full base URL like `https://your-proxy.com/v1` for option 3","Choose option 1 (International) or 2 (China) if a custom proxy is not actually needed","Verify the paste actually landed in the prompt input before pressing Enter"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (choice === '3' && !/^https?:\\/\\/.+/.test(customUrl.trim())) throw new Error('Option 3 requires a full http(s) base URL');","typeGuard":null,"tryCatchPattern":"try { creds = await loginAlibabaCodingPlan(controller); } catch (e) { if (e instanceof AIError.ConfigurationError && String(e.message).includes('Custom URL')) creds = await loginAlibabaCodingPlan(controllerChoosingDefault); else throw e; }","preventionTips":["Pick option 3 only with a working proxy URL available","Pre-fill previously used custom URLs","Smoke-test the custom URL before completing login"],"tags":["configuration","interactive-login","url"],"backgroundTag":"missing-config-value","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}