{"record":{"id":"68dc3ca6e2e94c84","repo":"jackwener/OpenCLI","slug":"tab-must-be-configured-run-history-task-templa","errorCode":null,"errorMessage":"tab must be configured / run-history / task-template","messagePattern":"tab must be configured / run-history / task-template","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/trae-solo/automation.js","lineNumber":62,"sourceCode":"    access: 'read',\n    description: 'List Trae SOLO Automation tab content. Default tab is \"Configured\"; pass --tab to switch.',\n    domain: 'localhost',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [\n        { name: 'tab', required: false, default: 'configured', help: 'Tab to view: configured / run-history / task-template' },\n        { name: 'limit', type: 'int', required: false, default: 50 },\n    ],\n    columns: ['Index', 'Title', 'Summary'],\n    func: async (page, kwargs) => {\n        await switchToPanel(page, 'Automation');\n        const tab = String(kwargs.tab || 'configured').trim().toLowerCase();\n        const tabLabel = {\n            'configured': 'Configured',\n            'run-history': 'Run History',\n            'task-template': 'Task Template',\n        }[tab];\n        if (!tabLabel) throw new ArgumentError('tab must be configured / run-history / task-template');\n        await switchToAutomationTab(page, tabLabel);\n\n        const items = await page.evaluate(`(function() {\n      // Each tab renders its content in a different container; pull all\n      // direct text rows from the main panel area.\n      const main = document.querySelector('.task-list-base-content') || document.querySelector('main') || document.body;\n      // Templates use .templateCard-... or similar. Configured items have a different shape.\n      const candidates = Array.from(main.querySelectorAll('[class*=\"templateCard\"], [class*=\"taskCard\"], [class*=\"card\"], li, [role=\"listitem\"]'))\n        .filter((el) => el.offsetParent);\n      const out = [];\n      const seen = new Set();\n      for (const el of candidates) {\n        const t = (el.innerText || '').replace(/\\\\s+/g, ' ').trim();\n        if (!t || t.length < 3 || seen.has(t)) continue;\n        // Filter UI chrome (tabs / heading / 'Create manually' / etc.)\n        if (/^(Configured|Run History|Task Template|Create manually|Create in chat|Automation|Create from a template)$/.test(t)) continue;\n        seen.add(t);\n        const lines = t.split('\\\\n');","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/automation.js#L44-L80","documentation":"The automation-list command normalizes kwargs.tab and maps it to a UI tab label ('configured' | 'run-history' | 'task-template'). If the value doesn't match any key, the label lookup yields undefined and this ArgumentError is thrown before any browser interaction. It's strict input validation of the --tab option.","triggerScenarios":"Passing tab with a value outside the allowed set, e.g. --tab history, --tab Templates, --tab 'run history' (space instead of hyphen), or any unrecognized string.","commonSituations":"Guessing tab names from memory; mixing up 'run-history' with 'history' or 'runs'; capitalization handled but hyphenation not; passing an empty/whitespace string is fine (defaults to 'configured') but a wrong word is not.","solutions":["Use exactly one of: configured, run-history, task-template (case/whitespace insensitive)","Fix hyphenation: use run-history not 'run history' or 'history'","Omit --tab entirely to use the default 'configured'","Check the CLI help for the automation-list command to see allowed values"],"exampleFix":"// before\nawait traeSoloCli.automationList({ tab: 'history' }); // throws\n// after\nawait traeSoloCli.automationList({ tab: 'run-history' });","handlingStrategy":"validation","validationCode":"const ALLOWED_TABS = ['configured', 'run-history', 'task-template'];\nconst tab = String(kwargs.tab ?? 'configured').trim().toLowerCase();\nif (!ALLOWED_TABS.includes(tab)) throw new Error(`tab must be one of ${ALLOWED_TABS.join(', ')}`);","typeGuard":"const isTab = (t) => ['configured','run-history','task-template']\n  .includes(String(t ?? 'configured').trim().toLowerCase());","tryCatchPattern":"try {\n  await traeSoloCli.automationList({ tab });\n} catch (e) {\n  if (e instanceof ArgumentError && /tab must be/.test(e.message)) {\n    console.error('Allowed tabs: configured, run-history, task-template');\n  } else throw e;\n}","preventionTips":["Use the documented hyphenated values verbatim: run-history, not 'run history'","Omit tab to accept the 'configured' default","Wrap CLI option parsing with an allowlist before invoking the command"],"tags":["argument-validation","cli","trae-solo"],"backgroundTag":"invalid-argument-value","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}