{"record":{"id":"29aaa231bc48360c","repo":"jackwener/OpenCLI","slug":"chatgpt-send-cannot-use-new-and-conversation-t","errorCode":null,"errorMessage":"chatgpt send cannot use --new and --conversation together","messagePattern":"chatgpt send cannot use --new and --conversation together","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/chatgpt/send.js","lineNumber":37,"sourceCode":"    access: 'write',\n    description: 'Send a prompt to ChatGPT web without waiting for the response',\n    domain: CHATGPT_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    siteSession: 'persistent',\n    navigateBefore: false,\n    args: [\n        { name: 'prompt', positional: true, required: true, help: 'Prompt to send' },\n        { name: 'new', type: 'boolean', default: false, help: 'Start a new chat before sending' },\n        { name: 'conversation', valueRequired: true, help: 'Continue an existing ChatGPT conversation ID or /c/<id> URL' },\n        { name: 'project', valueRequired: true, help: 'Start a new chat inside a ChatGPT project ID or /g/g-p-<id> URL' },\n    ],\n    columns: ['Status', 'InjectedText'],\n    func: async (page, kwargs) => {\n        const prompt = requireNonEmptyPrompt(kwargs.prompt, 'chatgpt send');\n\n        if (normalizeBooleanFlag(kwargs.new) && kwargs.conversation) {\n            throw new ArgumentError(\n                'chatgpt send cannot use --new and --conversation together',\n                'Choose either a new chat or an existing conversation.',\n            );\n        }\n        if (kwargs.project && kwargs.conversation) {\n            throw new ArgumentError(\n                'chatgpt send cannot use --project and --conversation together',\n                'Choose either a project new chat or an existing conversation.',\n            );\n        }\n\n        if (kwargs.conversation) {\n            await openChatGPTConversation(page, kwargs.conversation);\n        } else if (kwargs.project) {\n            await navigateToProject(page, kwargs.project);\n        } else if (normalizeBooleanFlag(kwargs.new)) {\n            await startNewChat(page);\n        } else {","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/chatgpt/send.js#L19-L55","documentation":"ArgumentError thrown by `chatgpt send` when both `--new` (a truthy boolean flag) and `--conversation` are provided. The two are mutually exclusive: one starts a new chat, the other targets an existing conversation.","triggerScenarios":"Invoking `opencli chatgpt send \"prompt\" --new --conversation <id>` — normalizeBooleanFlag(kwargs.new) is true while kwargs.conversation is set.","commonSituations":"Scripts accumulating flags from defaults; alias/config files that always add --new; misunderstanding of flag semantics; copy-pasting example commands with conflicting options.","solutions":["Remove --new if you want to send into the existing conversation.","Remove --conversation if you want a fresh chat.","Review wrapper scripts/config for a hardcoded --new flag."],"exampleFix":"// before\nopencli chatgpt send \"hello\" --new --conversation conv_abc\n// after (pick one)\nopencli chatgpt send \"hello\" --conversation conv_abc","handlingStrategy":"validation","validationCode":"const args = ['--new', '--conversation', 'conv_abc'];\nconst hasNew = args.includes('--new');\nconst convIdx = args.indexOf('--conversation');\nif (hasNew && convIdx !== -1) {\n  throw new Error('chatgpt send cannot use --new and --conversation together');\n}","typeGuard":"function flagsAreExclusive(opts) { return !(opts.new && Boolean(opts.conversation)); }","tryCatchPattern":"try {\n  await run(['chatgpt', 'send', prompt, ...flags]);\n} catch (err) {\n  if (String(err.message).includes('cannot use --new and --conversation')) {\n    console.error('Pick either a new chat or an existing conversation.');\n  }\n}","preventionTips":["Never combine --new with --conversation; choose one target.","Audit wrapper scripts/config for hardcoded --new defaults.","Validate flag combinations before invoking the CLI."],"tags":["argument-validation","cli","mutually-exclusive","chatgpt"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}