
We meet something similar in Genesis 18 and Exodus 32. In these stories Abraham and Moses respectively convince God that destroying people is not necessarily the best thing to do, and frankly questionable considering the kind of God God is. Some people are tempted to read this as literally true, which makes God needing to be persuaded. (Or at best a test of Abraham and Moses). Whether these stories have some more ancient source and began their life with such an interpretation, this is not how they function in the Bible now. They are, again, literary devices highlighting that, even under extremis God is just and merciful (Gen 18) and faithful to the covenant (Exod 32). In the latter case, it is the covenant that is more important than the sin itself, and God acts on sin, not the other way around. This comes directly out of the source of the covenant, but more on that later.
For further discussion of this point see Rowan Williams, Tokens of Trust, pp. 17-19, or point 12 in my Chapter 1 study notes.
For Pentecost 22(A)