Carefully add the peppers, salt, and pepper flakes, if using. Sauté over medium heat until the vegetables are very soft but not browning, about 10 minutes. Stir in the tomatoes and potatoes. Cover with the stock or water and bring to a boil. Turn the heat down to medium-low and simmer, stirring occasionally, until the potatoes are tender and the broth has thickened, about 15 minutes. Season the cod with salt, nestle it into the tomato mixture, and cover with a lid. Simmer until the fish is tender but not falling apart, about 7 minutes.