{"record":{"id":"ef861ec6d62caaef","repo":"jackwener/OpenCLI","slug":"claude-detail-requires-a-conversation-id","errorCode":null,"errorMessage":"claude detail requires a conversation id","messagePattern":"claude detail requires a conversation id","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/claude/utils.js","lineNumber":90,"sourceCode":"        throw new ArgumentError(\n            `${commandName} prompt cannot be empty`,\n            `Example: opencli ${commandName} \"hello\"`,\n        );\n    }\n    return text;\n}\n\nexport function requirePositiveInt(value, flagLabel, hint) {\n    if (!Number.isInteger(value) || value < 1) {\n        throw new ArgumentError(`${flagLabel} must be a positive integer`, hint);\n    }\n    return value;\n}\n\nexport function requireConversationId(value) {\n    const id = String(value ?? '').trim();\n    if (!id) {\n        throw new ArgumentError(\n            'claude detail requires a conversation id',\n            'Example: opencli claude detail 123e4567-e89b-12d3-a456-426614174000',\n        );\n    }\n    return id;\n}\n\nexport async function getVisibleMessages(page) {\n    const result = await page.evaluate(`(() => {\n        var nodes = document.querySelectorAll('[data-testid=\"user-message\"], ${MESSAGE_SELECTOR}');\n        var rows = [];\n        Array.from(nodes).forEach(function(el) {\n            var isUser = el.getAttribute('data-testid') === 'user-message';\n            var raw = (el.innerText || '').trim();\n            if (!isUser) {\n                var parts = raw.split(/\\\\n\\\\n+/);\n                while (parts.length > 1 && /^(Thought|View)\\\\b/i.test(parts[0])) parts.shift();\n                raw = parts.join('\\\\n\\\\n').trim();","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/claude/utils.js#L72-L108","documentation":"requireConversationId validates that a conversation id was supplied for commands that inspect a specific conversation (e.g. `opencli claude detail`). The id is required to locate the conversation, so a missing/empty value throws this ArgumentError with a usage example.","triggerScenarios":"Running `opencli claude detail` with no positional id argument, or with an empty/whitespace value from an unset variable.","commonSituations":"Scripting where the id comes from a previous command whose output was not captured, forgetting the positional argument, confusing detail with the list command.","solutions":["Supply the conversation id: `opencli claude detail 123e4567-...`","Run `opencli claude list` first to obtain a valid conversation id","Fix the script so the id variable is captured from the prior command's output"],"exampleFix":"// before\nconst id = process.env.CONV_ID; // undefined\nawait detailCommand({ id: requireConversationId(id) });\n// after\nconst id = await listCommand().then(r => r[0].id);\nawait detailCommand({ id: requireConversationId(id) });","handlingStrategy":"validation","validationCode":"const id = String(process.argv[3] ?? '').trim();\nif (!id) {\n  console.error('Usage: opencli claude detail <conversation-id>');\n  process.exit(2);\n}","typeGuard":"function isConversationId(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  await detailCommand({ id });\n} catch (e) {\n  if (e instanceof ArgumentError && e.message.includes('requires a conversation id')) {\n    console.error('Supply an id from `opencli claude list`');\n    process.exitCode = 2;\n  } else throw e;\n}","preventionTips":["Capture the id from `claude list` output programmatically","Require the positional argument in wrapper scripts","Validate UUID format if your ids are UUIDs","Avoid shell pipelines that drop the id variable"],"tags":["validation","argument-error","cli"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}