{"record":{"id":"afba71ba0af6eba3","repo":"nanocoai/nanoclaw","slug":"member-not-found","errorCode":null,"errorMessage":"member not found","messagePattern":"member not found","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/resources/members.ts","lineNumber":66,"sourceCode":"          new Date().toISOString(),\n        );\n        return { user_id: userId, agent_group_id: groupId };\n      },\n    },\n    remove: {\n      access: 'approval',\n      description: 'Remove a user from an agent group. Use --user and --group.',\n      handler: async (args) => {\n        const userId = args.user as string;\n        const groupId = args.group as string;\n        if (!userId) throw new Error('--user is required');\n        if (!groupId) throw new Error('--group is required');\n        const result = await getDb().run(\n          'DELETE FROM agent_group_members WHERE user_id = ? AND agent_group_id = ?',\n          userId,\n          groupId,\n        );\n        if (result.changes === 0) throw new Error('member not found');\n        return { removed: { user_id: userId, agent_group_id: groupId } };\n      },\n    },\n  },\n});\n","sourceCodeStart":48,"sourceCodeEnd":72,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/cli/resources/members.ts#L48-L72","documentation":"Thrown by `ncl members remove` when the DELETE statement affected zero rows — no agent_group_members row matched the given (user_id, agent_group_id) pair. This is a no-op guard so the operator knows nothing was removed.","triggerScenarios":"The user was never a member of that group, was already removed, or either id is wrong (e.g. user id missing the <channel>: prefix or the group id typo'd).","commonSituations":"Re-running a removal script that already succeeded; user id format mismatch (bare handle instead of channel-qualified id); user belongs to a different group.","solutions":["Check current membership: `ncl members list --group <gid>`","Verify the user id format with `ncl users list` (must be <channel>:<handle>)","If already removed, treat the end state as correct and continue"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const members = await listMembers(groupId); if (!members.some(m => m.user_id === userId)) { /* already absent */ }","typeGuard":null,"tryCatchPattern":"try { await removeMember(uid, gid); } catch (e) { if (e.message === 'member not found') return; /* idempotent success */ throw e; }","preventionTips":["Check membership before deleting","Make removal scripts idempotent by swallowing not-found"],"tags":["cli","not-found","members","idempotency"],"backgroundTag":"entity-not-found","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}