{"record":{"id":"38502714af76fa10","repo":"jackwener/OpenCLI","slug":"chatgpt-send-cannot-use-project-and-conversati","errorCode":null,"errorMessage":"chatgpt send cannot use --project and --conversation together","messagePattern":"chatgpt send cannot use --project and --conversation together","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/chatgpt/send.js","lineNumber":43,"sourceCode":"    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 {\n            await ensureOnChatGPT(page);\n        }\n        // startNewChat / ensureOnChatGPT now wait for the composer selector\n        // after navigating, so the previous standalone 2 s settle is redundant.\n        await ensureChatGPTComposer(page, 'ChatGPT send requires a logged-in ChatGPT session with a visible composer.');\n","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/chatgpt/send.js#L25-L61","documentation":"ArgumentError thrown by `chatgpt send` when both `--project` and `--conversation` are supplied. A project new chat and an existing conversation are mutually exclusive send targets.","triggerScenarios":"Invoking `opencli chatgpt send \"prompt\" --project <id> --conversation <id>` so both kwargs.project and kwargs.conversation are set.","commonSituations":"Script templating that always injects --project; confusion about whether project mode can target an existing conversation; copy-pasted command lines from different examples merged.","solutions":["Drop --conversation to send a new chat inside the project.","Drop --project to send into the existing conversation.","Audit wrapper scripts that auto-append --project or --conversation."],"exampleFix":"// before\nopencli chatgpt send \"hello\" --project 42 --conversation conv_abc\n// after\nopencli chatgpt send \"hello\" --conversation conv_abc","handlingStrategy":"validation","validationCode":"const hasProject = args.includes('--project');\nconst hasConv = args.includes('--conversation');\nif (hasProject && hasConv) {\n  throw new Error('chatgpt send cannot use --project and --conversation together');\n}","typeGuard":"function flagsAreExclusive(opts) { return !(Boolean(opts.project) && Boolean(opts.conversation)); }","tryCatchPattern":"try {\n  await run(['chatgpt', 'send', prompt, ...flags]);\n} catch (err) {\n  if (String(err.message).includes('cannot use --project and --conversation')) {\n    console.error('Choose either a project new chat or an existing conversation.');\n  }\n}","preventionTips":["Drop --conversation when sending a project new chat, and vice versa.","Check templating scripts that auto-append --project.","Document flag exclusivity in team command wrappers."],"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"}