{"record":{"id":"0ce6bff38e21b6a2","repo":"paperclipai/paperclip","slug":"ambiguous-workspace-path","errorCode":"ambiguous_workspace_path","errorMessage":"Workspace path matched multiple project workspaces","messagePattern":"Workspace path matched multiple project workspaces","errorType":"http","errorClass":"HttpError","httpStatus":409,"severity":"error","filePath":"server/src/services/workspace-file-resources.ts","lineNumber":1228,"sourceCode":"  ): Promise<AutoDiscovered<T>> {\n    const candidates = await sameCompanyProjectWorkspaceCandidates(issue, excludedWorkspaceIds);\n    const matches: T[] = [];\n    for (const candidate of candidates) {\n      if (candidate.remote) continue;\n      try {\n        matches.push(await check(candidate));\n      } catch (error) {\n        if (isHttpStatus(error, 404)) continue;\n        throw error;\n      }\n      if (matches.length > 1) return { state: \"ambiguous\", count: matches.length };\n    }\n    if (matches.length === 1) return { state: \"one\", value: matches[0]! };\n    return { state: \"none\" };\n  }\n\n  function throwAmbiguousWorkspacePath(count: number): never {\n    throw new HttpError(409, \"Workspace path matched multiple project workspaces\", {\n      code: \"ambiguous_workspace_path\",\n      matchCount: count,\n    });\n  }\n\n  async function availability(\n    issueId: string,\n    input: WorkspaceFileAvailabilityRequestInput,\n    opts: { issue?: IssueRow } = {},\n  ): Promise<WorkspaceFileAvailabilityResponse> {\n    const issue = opts.issue ?? await getIssue(issueId);\n    const uniqueQueries = new Map<string, PreparedAvailabilityQuery>();\n    for (const inputQuery of input.queries) {\n      const prepared = prepareAvailabilityQuery(inputQuery);\n      if (!uniqueQueries.has(prepared.key)) uniqueQueries.set(prepared.key, prepared);\n    }\n    const queries = [...uniqueQueries.values()];\n    if (queries.length === 0) return { kind: \"workspace_file_availability\", results: [] };","sourceCodeStart":1210,"sourceCodeEnd":1246,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/workspace-file-resources.ts#L1210-L1246","documentation":"Auto-discovery ambiguity result: when scanning the issue's same-company project workspaces for a target (path/candidate), more than one workspace matched, so Paperclip cannot safely pick one. The ambiguous state surfaces as an error asking the caller to disambiguate with an explicit projectId/workspaceId target.","triggerScenarios":"Thrown at server/src/services/workspace-file-resources.ts:1228 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The path maps to more than one project workspace. Disambiguate by specifying the project or using a more specific path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}