jackwener/OpenCLI · error · CommandExecutionError

ChatGPT did not create a conversation URL after sending the

Error message

ChatGPT did not create a conversation URL after sending the message.

What it means

`chatgpt ask` sends the prompt via browser automation, then waitForConversationUrl (clis/chatgpt/ask.js:24) polls page URL for up to 30 seconds trying to parse a /c/<conversationId> segment. If no conversation URL appears within the timeout (parseChatGPTConversationId keeps throwing), it throws this CommandExecutionError.

Source

Thrown at clis/chatgpt/ask.js:35

    selectChatGPTTool,
    isGenerating,
    startNewChat,
    navigateToProject,
    waitForChatGPTResponse,
} from './utils.js';

async function waitForConversationUrl(page, timeoutSeconds = 30) {
    const startTime = Date.now();
    while (Date.now() - startTime < timeoutSeconds * 1000) {
        const conversationUrl = await currentChatGPTUrl(page);
        try {
            const conversationId = parseChatGPTConversationId(conversationUrl);
            return { conversationId, conversationUrl };
        } catch {
            await page.wait(1);
        }
    }
    throw new CommandExecutionError('ChatGPT did not create a conversation URL after sending the message.');
}

export const askCommand = cli({
    site: 'chatgpt',
    name: 'ask',
    access: 'write',
    description: 'Send a prompt to ChatGPT web and wait for the response',
    domain: CHATGPT_DOMAIN,
    strategy: Strategy.COOKIE,
    browser: true,
    siteSession: 'persistent',
    navigateBefore: false,
    args: [
        { name: 'prompt', positional: true, required: true, help: 'Prompt to send' },
        { name: 'timeout', type: 'int', default: 120, help: 'Max seconds to wait for response' },
        { name: 'new', type: 'boolean', default: false, help: 'Start a new chat before sending' },
        { name: 'conversation', valueRequired: true, help: 'Continue an existing ChatGPT conversation ID or /c/<id> URL' },
        { name: 'project', valueRequired: true, help: 'Start a new chat inside a ChatGPT project ID or /g/g-p-<id> URL' },

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Rerun with a larger timeout and verify the session: open chatgpt.com in the automated browser and confirm you are logged in
  2. Check whether the message actually sent (composer cleared / response appearing); handle login or Cloudflare challenges first
  3. Retry after rate limits/captchas; if the site changed its URL scheme, update the library to a matching version

Example fix

// before
await waitForConversationUrl(page); // 30s default
// after
let result;
for (let i = 0; i < 3; i++) {
  try { result = await waitForConversationUrl(page, 60); break; }
  catch (e) { if (i === 2) throw e; await sendChatGPTMessage(page, prompt); }
}
Defensive patterns

Strategy: retry

Validate before calling

// before asking, confirm an authenticated session
const url = await page.url();
if (url.includes('auth') || url.includes('login')) throw new Error('ChatGPT session expired - re-authenticate');

Try / catch

try {
  const { conversationUrl } = await waitForConversationUrl(page);
} catch (e) {
  if (String(e.message).includes('did not create a conversation URL')) {
    await startNewChat(page);
    await sendChatGPTMessage(page, prompt);
    const { conversationUrl } = await waitForConversationUrl(page); // one retry
  } else throw e;
}

Prevention

When it happens

Trigger: Sending a message in the browser session where ChatGPT never navigates to a /c/<id> URL: send failed silently, login/rate-limit wall, Cloudflare challenge, network error, or page stuck generating without navigation within the 30s loop.

Common situations: Expired or invalid session cookies causing redirect to login; ChatGPT outage or heavy load; usage-capped accounts; slow networks where navigation lags past 30 seconds.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/f457feec50171c4e. Report an issue: GitHub.