nanocoai/nanoclaw · error · Error
provide --agent-group-id or --agent-group <folder>
Error message
provide --agent-group-id or --agent-group <folder>
What it means
Wiring creation requires an agent group, resolved either by --agent-group-id or by --agent-group <folder-or-name>; if neither is given it throws.
Source
Thrown at src/cli/resources/wirings.ts:193
const channelType = args.channel_type as string;
const platformId = args.platform_id as string;
if (!channelType || !platformId) {
throw new Error('provide --messaging-group-id, or --channel-type and --platform-id to resolve it');
}
const mg = await getMessagingGroupByPlatform(
channelType,
platformId,
(args.instance as string) ?? channelType,
);
if (!mg) throw new Error(`no messaging group for ${channelType} ${platformId} — create it first`);
mgId = mg.id;
}
// Resolve the agent group (by id or by folder).
let agId = args.agent_group_id as string | undefined;
if (!agId) {
const ref = args.agent_group as string;
if (!ref) throw new Error('provide --agent-group-id or --agent-group <folder>');
const ag = (await getAgentGroup(ref)) ?? (await getAgentGroupByFolder(ref));
if (!ag) throw new Error(`no agent group "${ref}" (by id or folder)`);
agId = ag.id;
}
// Idempotent: a wiring for this pair already exists → return it
// (defaults/validation/side-effects are skipped — nothing new is written).
const existing = await getMessagingGroupAgentByPair(mgId, agId);
if (existing) return existing;
// Pass-1 parity: only defined keys enter `values` (an unset
// engage_pattern stays absent → column NULL), enums validated.
const values: Record<string, unknown> = {
id: randomUUID(),
messaging_group_id: mgId,
agent_group_id: agId,
created_at: new Date().toISOString(),
};View on GitHub (pinned to 294ef2aee8)
Solutions
- Add --agent-group <folder> (or --agent-group-id <id>)
- List candidates with `ncl groups list`
Example fix
# before ncl wirings create --channel-type discord --platform-id 123 # after ncl wirings create --channel-type discord --platform-id 123 --agent-group myagent
Defensive patterns
Strategy: validation
Validate before calling
if (!agId && !agentGroupRef) throw new Error('need --agent-group-id or --agent-group'); Prevention
- Always pass an explicit agent group when scripting wiring creation
When it happens
Trigger: ncl wirings create with only messaging-group arguments and no agent group reference.
Common situations: Forgetting the agent side of the wiring, or assuming a default agent group exists.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- provide --messaging-group-id, or --channel-type and --platfo
- Provide --apt <pkg> or --npm <pkg>
- Provide --host <host-path> and --container <container-path>
- messaging group not found: ${id}
- no messaging group for ${channelType} ${platformId} — create
AI-assisted analysis of nanocoai/nanoclaw@294ef2aee8 (2026-08-28).
Data as JSON: /api/errors/e554301aadeb3421.
Report an issue: GitHub.