jackwener/OpenCLI · warning · ArgumentError

${e.message}. Archived channels are excluded from the name l

Error message

${e.message}. Archived channels are excluded from the name lookup; pass the channelId UUID instead (find it in the archived channel's URL in the Slock app).

What it means

This ArgumentError is thrown by `makeChannelActionCommand` in clis/slock/channel-action.js when a channel action (e.g. unarchive) fails channel resolution because the underlying GraphQL lookup (`channelResolveFragment`) only lists ACTIVE channels. The CLI catches the generic 'no channel matches' failure and rewrites it with an actionable hint: archived channels cannot be found by `#name`, only by their channelId UUID.

Source

Thrown at clis/slock/channel-action.js:48

      if (!channel) throw new ArgumentError('channel required');
      await page.goto(SLOCK_HOME_URL);
      const snippet = buildChannelScopedSnippet({
        channelInput: channel,
        method: 'POST',
        pathSuffix: `/${verb}`,
        serverIdOverride: kwargs.server,
      });
      const result = await page.evaluate(`(async () => { ${snippet} })()`);
      let data;
      try {
        data = dispatchEvaluateResult(result);
      } catch (e) {
        // F7 — channelResolveFragment lists active channels only; archived
        // channels are absent from the lookup, so `#name` resolve fails for
        // a channel you're trying to unarchive. UUID still works. Rewrite
        // the bare "no channel matches" message into something actionable.
        if (archivedHint && e instanceof ArgumentError && /no channel matches/.test(e.message)) {
          throw new ArgumentError(
            `${e.message}. Archived channels are excluded from the name lookup; ` +
            `pass the channelId UUID instead (find it in the archived channel's URL in the Slock app).`
          );
        }
        throw e;
      }
      return [{
        channel,
        id: data?.id ?? '',
        archivedAt: data?.archivedAt ?? null,
        result: resultLabel,
      }];
    },
  });
}

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Get the channelId UUID from the archived channel's URL in the Slock app (the value in the path after /channel/) and pass that instead of `#name`
  2. Run a channel action with the UUID: `slock channel unarchive --channel <uuid>`
  3. After unarchiving succeeds, the channel becomes active again and `#name` lookup will work for future commands

Example fix

// before
$ slock channel unarchive --channel '#ops-alerts'
Error: no channel matches ... Archived channels are excluded from the name lookup; pass the channelId UUID instead...
// after
$ slock channel unarchive --channel '3f9a2b1c-8d4e-4f7a-9b2c-1e5d6a7b8c9d'
Defensive patterns

Strategy: try-catch

Validate before calling

const uuidRe = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
if (channel.startsWith('#')) {
  console.warn('#name lookup only works for active channels; for archived channels pass the channelId UUID from the Slock app URL');
} else if (!uuidRe.test(channel)) {
  console.warn('channel does not look like a UUID; extract it from the channel URL in the Slock app');
}

Type guard

const isUuid = (v) => typeof v === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(v.trim());

Try / catch

try {
  await slock.channelAction({ channel: '#ops', action: 'unarchive' });
} catch (e) {
  if (e instanceof ArgumentError && /Archived channels are excluded/.test(e.message)) {
    // fall back to the UUID stored in your channel registry / channel URL
    await slock.channelAction({ channel: ARCHIVED_CHANNEL_UUID, action: 'unarchive' });
  } else throw e;
}

Prevention

When it happens

Trigger: Running a channel action command with `archivedHint` enabled (e.g. `slock channel unarchive --channel '#my-channel'`) where the target channel is archived. The name-based lookup excludes archived channels, so resolve fails with 'no channel matches' and is rewritten to this message.

Common situations: A developer archived a channel in the Slock app and later wants to restore it via the CLI. They naturally reference it by `#name`, forgetting the lookup only covers active channels. Also occurs after automation scripts stored channel names rather than UUIDs.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/0980770769c36761. Report an issue: GitHub.