{"record":{"id":"6924a310f2d47dbf","repo":"stablyai/orca","slug":"linear-attribute-filters-require-a-concrete-worksp","errorCode":null,"errorMessage":"Linear attribute filters require a concrete workspace; \"all\" workspaces is not supported.","messagePattern":"Linear attribute filters require a concrete workspace; \"all\" workspaces is not supported\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/linear/issues.ts","lineNumber":1075,"sourceCode":"}\n\nexport async function listIssues(\n  filter: LinearListFilter = 'assigned',\n  limit = 20,\n  workspaceId?: LinearWorkspaceSelection | null,\n  options?: LinearIssueListOptions\n): Promise<LinearCollectionResult<LinearIssue>> {\n  const effectiveLimit = clampLinearIssueListLimit(limit)\n  const attributeFilter = options?.attributeFilter\n  // Why: workspace-specific state/member/label ids cannot fan out safely across\n  // \"all\" workspaces; reject before creating clients so non-UI callers cannot\n  // get a misleading partial subset.\n  if (\n    attributeFilter &&\n    !isEmptyLinearIssueAttributeFilter(attributeFilter) &&\n    workspaceId === 'all'\n  ) {\n    throw new Error(\n      'Linear attribute filters require a concrete workspace; \"all\" workspaces is not supported.'\n    )\n  }\n  const entries = getClients(workspaceId)\n  if (entries.length === 0) {\n    return { items: [] }\n  }\n\n  if (entries.length === 1) {\n    return readListIssuesForWorkspace(entries[0], filter, effectiveLimit, workspaceId, options)\n  }\n\n  return readListIssuesAcrossWorkspaces(entries, filter, effectiveLimit, workspaceId, options)\n}\n\nexport async function createIssue(\n  teamId: string,\n  title: string,","sourceCodeStart":1057,"sourceCodeEnd":1093,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/linear/issues.ts#L1057-L1093","documentation":"Thrown by listIssues when an attributeFilter (state/member/label ids) is supplied together with workspaceId==='all'. Workspace-scoped ids cannot be safely fanned out across multiple workspaces, so the library rejects this combination before creating any client. It is a plain Error, not a LinearWriteFailure.","triggerScenarios":"Passing options.attributeFilter that is non-empty (per isEmptyLinearIssueAttributeFilter) while workspaceId is the literal string 'all'. Typically a multi-workspace UI selection combined with a state/assignee/label filter.","commonSituations":"UI defaulted to 'All workspaces' and the user applied a state or label filter whose ids only exist in one workspace; an agent or background job reused a default 'all' selection with scoped filters.","solutions":["Resolve a single concrete workspace id before applying an attribute filter.","If the user picked 'all', either clear the attributeFilter or run the query once per workspace with each workspace's own scoped ids.","Validate at the call site that attributeFilter and workspaceId==='all' never travel together."],"exampleFix":"// before\nlistIssues('assigned', 20, 'all', { attributeFilter: { stateIds: ['state-1'] } })\n// after\nconst ws = resolveWorkspaceId(selection)\nlistIssues('assigned', 20, ws, { attributeFilter: { stateIds: ['state-1'] } })","handlingStrategy":"validation","validationCode":"function assertConcreteForAttributeFilter(workspaceId: unknown, attributeFilter: unknown): void {\n  if (workspaceId === 'all' && attributeFilter && !isEmptyAttributeFilter(attributeFilter))\n    throw new Error('Resolve a single workspace before applying an attribute filter')\n}","typeGuard":"function isAllWorkspaceFilterError(e: unknown): boolean {\n  return e instanceof Error && e.message.includes('attribute filters require a concrete workspace')\n}","tryCatchPattern":"try { listIssues('assigned', 20, selection, { attributeFilter }) }\ncatch (e) { if (isAllWorkspaceFilterError(e)) selection = pickConcreteWorkspace(); else throw e }","preventionTips":["Never forward an 'all' UI selection into a scoped-filter query unchanged.","Centralize workspace narrowing before building attributeFilter.","Unit-test the boundary with workspaceId='all' plus a non-empty filter."],"tags":["linear","validation","workspace","attribute-filter"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}