{"record":{"id":"7126a5ecbba9d630","repo":"jackwener/OpenCLI","slug":"selector-7126a5","errorCode":"SELECTOR","errorMessage":"Could not find element: TRAE SOLO model trigger (.core-model-select-trigger). Make sure a chat task is open (not the project-list view).","messagePattern":"Could not find element: TRAE SOLO model trigger \\(\\.core-model-select-trigger\\)\\. Make sure a chat task is open \\(not the project-list view\\)\\.","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/trae-solo/model.js","lineNumber":32,"sourceCode":"    name: 'model',\n    access: 'write',\n    description: 'Read or switch the current AI model in TRAE SOLO. Without arguments, reports the current model. With <name> argument (substring, case-insensitive), switches to a matching model. Pass --list to enumerate available models.',\n    domain: 'localhost',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [\n        { name: 'name', required: false, positional: true, help: 'Target model name (substring match, case-insensitive). Omit to read current.' },\n        { name: 'list', type: 'boolean', default: false, help: 'List all available models (does not switch)' },\n    ],\n    columns: ['Status', 'Model'],\n    func: async (page, kwargs) => {\n        const name = String(kwargs.name || '').trim().toLowerCase();\n        const listOnly = kwargs.list === true || kwargs.list === 'true';\n\n        // Read current model from the composer trigger\n        const current = await readCurrentModel(page);\n        if (!current) {\n            throw selectorError('TRAE SOLO model trigger (.core-model-select-trigger). Make sure a chat task is open (not the project-list view).');\n        }\n\n        // List or switch — both require opening the menu\n        if (listOnly || name) {\n            const namejson = JSON.stringify(name);\n\n            // Stage 1 (eval): open the trigger + enumerate option labels.\n            const stage1 = await page.evaluate(`(async () => {\n        const wait = (ms) => new Promise((r) => setTimeout(r, ms));\n        const trigger = document.querySelector('.core-model-select-trigger');\n        if (!trigger) return { ok: false, reason: 'model trigger gone' };\n        const r = trigger.getBoundingClientRect();\n        const init = {\n          bubbles: true, cancelable: true, button: 0, buttons: 1,\n          clientX: Math.round(r.left + Math.min(r.width / 2, 20)),\n          clientY: Math.round(r.top + Math.min(r.height / 2, 10)),\n        };\n        trigger.dispatchEvent(new PointerEvent('pointerdown', { ...init, pointerType: 'mouse' }));","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/model.js#L14-L50","documentation":"selectorError is thrown when the TRAE SOLO composer's model selector trigger element (.core-model-select-trigger) cannot be found on the page. readCurrentModel returned no value, meaning the DOM does not contain the trigger, which typically only renders inside an open chat/SOLO task view.","triggerScenarios":"Calling the model command (list or switch) via clis/trae-solo/model.js while the browser page is not showing a chat task — e.g. the project-list view is open, or no SOLO task session exists.","commonSituations":"User ran the model command before opening a chat task; the tab navigated back to the project list; the TRAE SOLO UI changed and the .core-model-select-trigger class no longer exists in that page version.","solutions":["Open a SOLO chat task in TRAE so the composer (and its .core-model-select-trigger) is rendered, then retry","Navigate the controlled page back to the chat/task view, not the project-list view","Verify the page actually finished loading the composer before running the model command","If the UI changed, update the .core-model-select-trigger selector in model.js to the new class name"],"exampleFix":"// before: running against project-list view\nawait opencli trae-solo model --list\n// after: open a chat task first\nawait opencli trae-solo open --task '...' && opencli trae-solo model --list","handlingStrategy":"validation","validationCode":"const ready = await page.$('.core-model-select-trigger');\nif (!ready) throw new Error('Open a TRAE SOLO chat task before running the model command');","typeGuard":"function hasModelTrigger(page) { return page.$('.core-model-select-trigger').then(Boolean); }","tryCatchPattern":"try {\n  await opencli trae-solo model --list;\n} catch (e) {\n  if (e.code === 'SELECTOR' && /core-model-select-trigger/.test(e.message)) {\n    await openTraeChatTask(); // navigate to a chat task, then retry once\n    await opencli trae-solo model --list;\n  } else throw e;\n}","preventionTips":["Always open a SOLO chat task before model commands","Check the trigger element exists before invoking model operations","Keep selectors in model.js updated against TRAE UI changes","Avoid navigating the controlled tab away from the chat view mid-automation"],"tags":["selector","dom","ui-automation"],"backgroundTag":"selector-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}