nanocoai/nanoclaw · error · MissingChannelAdapterError

MissingChannelAdapterError(channelType, instance)

Error message

MissingChannelAdapterError(channelType, instance)

What it means

During the recursive walk, an entry name containing '/', '\\', or equal to '.'/'..' throws. readdir should never return such names, so this is a hard trust boundary — the module does not assume the filesystem API is honest.

Source

Thrown at src/channels/channel-registry.ts:112

 * adapters, so single-instance behavior is unchanged. A named instance whose
 * adapter is offline gets the normal offline-adapter handling
 * (MissingChannelAdapterError → the delivery retry path) — never a
 * cross-identity send through a sibling bot of the same platform.
 */
export function createChannelDeliveryAdapter(): ChannelDeliveryAdapter {
  return {
    async deliver(
      channelType: string,
      platformId: string,
      threadId: string | null,
      kind: string,
      content: string,
      files?: OutboundFile[],
      instance?: string,
    ): Promise<string | undefined> {
      const adapter = getChannelAdapterExact(instance ?? channelType);
      if (!adapter) {
        throw new MissingChannelAdapterError(channelType, instance);
      }
      return adapter.deliver(platformId, threadId, { kind, content: JSON.parse(content), files });
    },
    async setTyping(
      channelType: string,
      platformId: string,
      threadId: string | null,
      instance?: string,
      status?: string,
      statusKind?: 'auto' | 'agent',
    ): Promise<void> {
      const adapter = getChannelAdapterExact(instance ?? channelType);
      await adapter?.setTyping?.(platformId, threadId, status, statusKind);
    },
  };
}

/**

View on GitHub (pinned to 294ef2aee8)

Solutions

  1. Inspect the directory listing directly to find the malformed entry name
  2. Repair or remove the corrupted directory entry
  3. If using an unusual filesystem layer, reproduce on a standard fs to confirm
Defensive patterns

Strategy: try-catch

Try / catch

try { walkPluginDir(dir); } catch (e) { if (e instanceof Error && e.message.includes('entry name') && e.message.includes('not allowed')) { /* inspect and repair the directory listing */ } else throw e; }

Prevention

When it happens

Trigger: Practically unreachable via fs.readdirSync on normal platforms; could surface on exotic filesystems or if the walk logic is reused with an injected directory listing.

Common situations: Essentially defensive-only; hitting it suggests filesystem corruption or a non-standard fs layer (FUSE, patched runtime).

Related errors


AI-assisted analysis of nanocoai/nanoclaw@294ef2aee8 (2026-08-28). Data as JSON: /api/errors/f36ec804df39857a. Report an issue: GitHub.