{"record":{"id":"4e6b121690a40ad1","repo":"Fission-AI/OpenSpec","slug":"buildlaunchcommand-requires-at-least-one-member","errorCode":null,"errorMessage":"buildLaunchCommand requires at least one member.","messagePattern":"buildLaunchCommand requires at least one member\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/openers.ts","lineNumber":338,"sourceCode":"  cwd: string;\n  label: string;\n  style: OpenerStyle;\n}\n\n/**\n * Pure argv builder. workspace-file: pre-args + the generated file's\n * absolute path (which also defuses the cursor shim's `agent`\n * first-arg hijack). attach-dirs: pre-args + one attach flag + path\n * pair per surviving member, the primary included (the locked \"one\n * attach flag per member\"); never a trailing positional - both agent\n * CLIs would read one as a starter prompt, which 7.1 locks out.\n */\nexport function buildLaunchCommand(\n  opener: OpenerDefinition,\n  input: { members: WorksetMember[]; codeWorkspacePath: string }\n): LaunchCommand {\n  if (input.members.length === 0) {\n    throw new Error('buildLaunchCommand requires at least one member.');\n  }\n\n  // The no-hijack and no-positional guarantees lean on absolute paths\n  // (the child resolves relative argv against its own cwd) - keep the\n  // invariant local instead of three modules away.\n  if (!path.isAbsolute(input.codeWorkspacePath)) {\n    throw new Error(\n      `buildLaunchCommand requires an absolute workspace-file path (got '${input.codeWorkspacePath}').`\n    );\n  }\n\n  const cwd = input.members[0].path;\n\n  if (opener.style === 'workspace-file') {\n    return {\n      executable: opener.command,\n      args: [...opener.args, input.codeWorkspacePath],\n      cwd,","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/openers.ts#L320-L356","documentation":"Pure-argv precondition in buildLaunchCommand: an empty members array was passed. The builder cannot construct a launch command (no workspace members to open or attach), so it throws immediately — callers must filter empty worksets before invoking it.","triggerScenarios":"Thrown at src/core/openers.ts:338 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the workset contains at least one member before building the launch command","Filter or reject empty worksets upstream of the opener","Pass a valid members array to buildLaunchCommand"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}