nexu-io/open-design · warning · Error

authoritative Team resource listing is unavailable

Error message

authoritative Team resource listing is unavailable

What it means

Thrown by the unconfigured TeamResourceShareService stub when sharedResources is called with readOptions.authoritative true. When shouldUseVelaCliResourceTransport(env) is false, the factory returns a stub whose non-authoritative reads return an empty list, but an authoritative read deliberately throws so a transport failure can never be confused with an authoritative empty list. Callers (reconciliation) must be able to tell 'unavailable' from 'genuinely empty'.

Source

Thrown at apps/daemon/src/collab/team-resource-share.ts:161

    args: string[],
    workspaceId?: string,
    readOptions?: TeamResourceSharedReadOptions,
  ) => Promise<string>;
  env?: NodeJS.ProcessEnv;
}

export function createTeamResourceShareService(
  options: CreateTeamResourceShareOptions,
): TeamResourceShareService {
  const env = options.env ?? process.env;
  if (!shouldUseVelaCliResourceTransport(env)) {
    return {
      share: async () => null,
      unshare: async () => false,
      sharedIds: async () => [],
      sharedResources: async (_scope, readOptions) => {
        if (readOptions?.authoritative) {
          throw new Error('authoritative Team resource listing is unavailable');
        }
        return [];
      },
      isShared: () => false,
      configured: false,
    };
  }
  // Distinct, colon-free id namespace on the shared hub. The caller's id (e.g.
  // `user:palette-x`) is sanitized to path-safe chars — the hub routes the
  // resource id as a path param, so a colon would 404.
  const sanitizeResourceIdSegment = (value: string) => value.replace(/[^a-zA-Z0-9_-]/g, '-');
  const scopedIdPrefixFor = (principal?: ResourceHubPrincipal | null) =>
    principal?.teamId
      ? `${options.idPrefix}-${sanitizeResourceIdSegment(principal.teamId)}`
      : options.idPrefix;
  const resourceIdFor = (id: string, principal?: ResourceHubPrincipal | null) =>
    `${scopedIdPrefixFor(principal)}-${sanitizeResourceIdSegment(id)}`;
  // Ids shared this session. The published resources are the durable record on

View on GitHub (pinned to 5be4028344)

Solutions

  1. Enable the Vela CLI resource transport via the required env vars so shouldUseVelaCliResourceTransport returns true.
  2. If the environment is intentionally non-team, do not request authoritative reads — omit readOptions or set authoritative false.
  3. Guard reconciliation with a check of `service.configured` before issuing an authoritative read.

Example fix

// before
const list = await service.sharedResources(scope, { authoritative: true });
// after
if (!service.configured) return []; // non-team environment
const list = await service.sharedResources(scope, { authoritative: true });
Defensive patterns

Strategy: fallback

Validate before calling

// Do not request an authoritative list from an unconfigured service.
async function safeSharedResources(service, scope, opts) {
  if (opts?.authoritative && !service.configured) return null; // 'unavailable'
  return service.sharedResources(scope, opts);
}

Try / catch

try {
  return await service.sharedResources(scope, { authoritative: true });
} catch (err) {
  if (err instanceof Error && /authoritative Team resource listing is unavailable/.test(err.message)) {
    // transport not configured — degrade to non-authoritative or skip reconciliation
    return await service.sharedResources(scope); // empty list in stub mode
  }
  throw err;
}

Prevention

When it happens

Trigger: A reconciliation or sync path requesting `sharedResources(scope, { authoritative: true })` while the Vela CLI resource transport is not enabled — e.g. local/dev without the OD_VELA collab env vars set, or collab explicitly disabled.

Common situations: Running the daemon locally without collab login configured, a misconfigured env that disables Vela transport, or a reconciliation job scheduled on an environment that was not provisioned for team resource sharing.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/5abb7b3d636e0793. Report an issue: GitHub.