Dashboard › cli › Distillation
89dbffab-2cbd-45dc-900f-52659b237216["lore_tm_v1_y_w6HHz9-e6nL5D56TyxvQ-TQBTgf_BDca6Gb1M6_jY","lore_tm_v1_kpkBfStsBNdc1vqz8cpv0yt6hJBmnZ6JVd4IXazrGl4"]
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/resolve-target.ts defines resolveOrgProjectOrGuide(options) as a drop-in replacement for resolveOrgAndProject(...) plus manual null handling: it returns await resolveOrgAndProject(options) or falls back to await guideOrgProjectFailure(options), which throws ContextError when resolution/selection fails.resolveOrg(options) resolves an organization in this exact priority order: 1. explicit options.org, 2. SENTRY_ORG / SENTRY_PROJECT via resolveFromEnvVars(), 3. .sentryclirc via loadSentryCliRc(cwd), 4. getDefaultOrganization(), 5. DSN auto-detection via resolveOrgFromDsn(cwd).resolveOrg() path calls setOrgProjectContext([org], []). Environment and .sentryclirc results include detectedFrom; the .sentryclirc value is formatted as ${CONFIG_FILENAME} (${rcConfig.sources.org}).resolveOrg() passes result.org through normalizeNumericOrg() because a cold project cache may yield a bare numeric organization ID that some endpoints, including dashboards, reject. DSN resolution exceptions are silently caught and converted to null; the catch carries a grandfathered Biome suppression referencing issue #1531.resolveProjectBySlug(projectSlug, usageHint, disambiguationExample?, originalSlug?) returns { org, project, projectData }. When originalSlug is defined, it treats the input as a display name, skips slug-based API lookups that would produce multiple 404s, calls listOrganizations(), and proceeds through triageProjectNotFound().resolveProjectBySlug() handles triageProjectNotFound() outcomes as follows: org-match throws ResolutionError explaining that the value is an organization rather than a project and suggests sentry project list ${projectSlug}/ plus ${projectSlug}/<project>; fuzzy-match verifies access using withAuthGuard(() => getProject(outcome.org, outcome.project)) and returns the recovered target through withTelemetryContext() when accessible.resolveProjectBySlug() throws ResolutionError with suggestions identifying the inaccessible similar project and either the numeric-ID hint "No project with this ID was found — check the ID or use the project slug instead" or the slug-access hint "Check that you have access to a project with this slug".not-found outcome, resolveProjectBySlug() chooses suggestions in this order: 1. the numeric-ID hint when isAllDigits(projectSlug), 2. outcome.suggestions when nonempty, 3. "Check that you have access to a project with this slug". The displayed project label preserves originalSlug when supplied.packages/cli/test/commands/agent-conversation/list.test.ts adds a test requiring failed organization resolution (resolveOrgSpy.mockResolvedValue(null)) to produce an error whose command is exactly "sentry agent-conversation list [<org>]", enforcing canonical optional-organization usage.