{"record":{"id":"22cfbc4e3665b5ff","repo":"stablyai/orca","slug":"linear-invalid-workspace","errorCode":"linear_invalid_workspace","errorMessage":"--workspace all is not valid for issue","messagePattern":"--workspace all is not valid for issue","errorType":"validation","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/linear-request-builders.ts","lineNumber":140,"sourceCode":"    comments: full || flags.get('comments') === true,\n    children: full || flags.get('children') === true,\n    attachments: full || flags.get('attachments') === true,\n    relations: full || flags.get('relations') === true,\n    activity: full || flags.get('activity') === true\n  }\n  if (flags.has('depth') && !includes.children) {\n    throw new RuntimeClientError('invalid_argument', '--depth requires --children or --full')\n  }\n  const requestedDepth = getOptionalNonNegativeIntegerFlag(flags, 'depth')\n  if (requestedDepth !== undefined && requestedDepth > LINEAR_CHILDREN_MAX_DEPTH) {\n    throw new RuntimeClientError(\n      'invalid_argument',\n      `--depth must be at most ${LINEAR_CHILDREN_MAX_DEPTH}`\n    )\n  }\n  const workspaceId = getOptionalStringFlag(flags, 'workspace')\n  if (workspaceId === 'all') {\n    throw new RuntimeClientError(\n      'linear_invalid_workspace',\n      '--workspace all is not valid for issue'\n    )\n  }\n  const input = getOptionalStringFlag(flags, 'id')\n  return {\n    input,\n    current: input ? false : flags.get('current') === true,\n    workspaceId,\n    include: includes,\n    depth: clampLinearIssueDepth(requestedDepth),\n    context: buildLinearCurrentContext(cwd, remote)\n  }\n}\n\nexport function buildWriteTargetRequest(\n  flags: Map<string, string | boolean>,\n  cwd: string,","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/linear-request-builders.ts#L122-L158","documentation":"Thrown by the Linear issue-fetch request builder when `--workspace all` is supplied while targeting a single issue. A specific Linear issue lives in exactly one workspace, so the 'all workspaces' scope (valid for listing/searching across workspaces) is meaningless for issue retrieval. The builder rejects it early so the request never reaches the Linear API.","triggerScenarios":"Calling `linear issue <id> --workspace all`, or combining `--current` with `--workspace all` when the command resolves to a single issue. Any code path that funnels through buildSingleIssueRequest (or equivalent) with workspaceId === 'all' triggers it at src/cli/linear-request-builders.ts:140.","commonSituations":"Copy-pasting a `--workspace all` flag from a successful `linear list`/`linear search` invocation into an `linear issue` command. Scripts that set `--workspace all` globally for all Linear subcommands. Aliases or shell wrappers that inject workspace defaults.","solutions":["Drop `--workspace all` from the issue command; a single issue is already workspace-scoped by its ID prefix.","If you need a different workspace, pass a concrete workspace id: `--workspace <team-or-workspace-id>`.","If you genuinely want issues across all workspaces, use `linear list` or `linear search` instead of `linear issue`."],"exampleFix":"// before\nlinear issue LIN-123 --workspace all\n// after\nlinear issue LIN-123","handlingStrategy":"validation","validationCode":"// before calling the issue builder\nconst workspace = flags.get('workspace')\nif (commandIsSingleIssueFetch && workspace === 'all') {\n  flags.delete('workspace') // or throw your own preflight error\n}\n// or assert at the shell layer:\n// if [[ \"$CMD\" == \"issue\" && \"$WORKSPACE\" == \"all\" ]]; then exit 2; fi","typeGuard":"function isAcceptableIssueWorkspace(ws: string | undefined): boolean {\n  return ws === undefined || ws !== 'all'\n}","tryCatchPattern":null,"preventionTips":["Do not set `--workspace all` globally in shared shell aliases; scope it to read subcommands only.","Validate flags in a thin wrapper before dispatching to the Linear CLI."],"tags":["linear","cli","flag-validation","workspace"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}