{"record":{"id":"348dbfb3ad9bf57e","repo":"remotion-dev/remotion","slug":"sequence-sequenceid-cannot-be-selected","errorCode":null,"errorMessage":"Sequence ${sequenceId} cannot be selected.","messagePattern":"Sequence (.+?) cannot be selected\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":997,"sourceCode":"\n\t\t\t\t\t\tif (!timelineSelectionRef.current.canSelect) {\n\t\t\t\t\t\t\tthrow new Error('Studio sequence selection is unavailable.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst timelineTrack = getCurrentTimeline().find(\n\t\t\t\t\t\t\t(candidate) => candidate.sequence.id === sequenceId,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (!timelineTrack) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Sequence ${sequenceId} not found in the current composition.`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst selection = getTimelineSelectionFromNodePathInfo(\n\t\t\t\t\t\t\ttimelineTrack.nodePathInfo,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (selection === null) {\n\t\t\t\t\t\t\tthrow new Error(`Sequence ${sequenceId} cannot be selected.`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelineSelectionRef.current.selectItems([selection], {\n\t\t\t\t\t\t\treveal: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn Promise.resolve({\n\t\t\t\t\t\t\tcurrentContent: currentContentRef.current,\n\t\t\t\t\t\t\tselectedSequence: serializeSequence(timelineTrack),\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{signal: controller.signal},\n\t\t\t),\n\t\t\tmodelContext.registerTool(\n\t\t\t\t{\n\t\t\t\t\tname: 'get_composition',\n\t\t\t\t\ttitle: 'Get Studio composition',\n\t\t\t\t\tdescription:","sourceCodeStart":979,"sourceCodeEnd":1015,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/studio/src/components/WebMcp.tsx#L979-L1015","documentation":"The Studio WebMcp tool for selecting a sequence resolves the given sequenceId to a timeline selection via getTimelineSelectionFromNodePathInfo. When that returns null, the id does not map to a selectable timeline node, and the tool throws instead of selecting nothing silently.","triggerScenarios":"Calling the WebMcp select-sequence tool with a sequenceId that has no corresponding track/nodePathInfo in the current timeline — e.g. the sequence is not in the current composition, was deleted, or the id is stale/misspelled.","commonSituations":"Agents or automation driving Remotion Studio via WebMcp referencing sequences from a different composition; a hot reload changed sequence ids; selecting before the timeline tracks are loaded.","solutions":["Verify the sequenceId exists in the currently opened composition (list compositions/sequences first).","Wait for the timeline to finish loading before invoking the selection tool.","Re-fetch current sequence ids after hot reload or composition switch.","Select a parent composition first if the sequence is nested and only reachable through it."],"exampleFix":"// before\nawait selectSequence('my-old-sequence'); // throws\n// after\nconst seqs = await listSequences();\nif (seqs.includes('my-old-sequence')) await selectSequence('my-old-sequence');","handlingStrategy":"validation","validationCode":"const known = new Set(getCurrentCompositionSequences().map((s) => s.id));\nif (!known.has(sequenceId)) throw new Error(`Unknown sequence: ${sequenceId}`);","typeGuard":"null","tryCatchPattern":"try {\n  await webmcp.selectSequence(sequenceId);\n} catch (err) {\n  if (err.message.includes('cannot be selected')) {\n    // re-list sequences and pick a valid id\n  }\n}","preventionTips":["List available sequences before selecting by id","Re-read ids after hot reload or composition switches","Never hardcode sequence ids across compositions"],"tags":["webmcp","selection","studio"],"backgroundTag":"record-not-found","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}