During the conflict between David and Shaul, David inquired of God (perhaps via the urim v'tummim) as to how to behave (where he should go, what he should do etc.). However, when his son Avshalom rebels David does not make any inquiries, instead he leave Yerushalayim and does not seem to seek the direction of God at all during the rebellion. Do any commentators explain why David changed his behavior and did not inquire from God during his flight and fight with Avshalom?
Refer to the Gemara in Brochos 7b:
״מִזְמוֹר לְדָוִד בְּבָרְחוֹ מִפְּנֵי אַבְשָׁלוֹם בְּנוֹ״, ״מִזְמוֹר לְדָוִד״?! ״קִינָה לְדָוִד״ מִיבְּעֵי לֵיהּאָמַר רַבִּי שִׁמְעוֹן בֶּן אֲבִישָׁלוֹם: מָשָׁל לְמָה הַדָּבָר דּוֹמֶה? — לְאָדָם שֶׁיָּצָא עָלָיו שְׁטַר חוֹב. קוֹדֶם שֶׁפְּרָעוֹ הָיָה עָצֵב, לְאַחַר שֶׁפְּרָעוֹ שָׂמַח. אַף כֵּן דָּוִד, כֵּיוָן שֶׁאָמַר לוֹ הַקָּדוֹשׁ בָּרוּךְ הוּא: ״הִנְנִי מֵקִים עָלֶיךָ רָעָה מִבֵּיתֶךָ״, הָיָה עָצֵב, אָמַר: שֶׁמָּא עֶבֶד אוֹ מַמְזֵר הוּא, דְּלָא חָיֵיס עֲלַי. כֵּיוָן דַּחֲזָא דְּאַבְשָׁלוֹם הוּא — שָׂמַח. מִשּׁוּם הָכִי אֲמַר ״מִזְמוֹר״
“A Psalm of Dovid, when fleeing his son, Avshalom.” A Psalm of Dovid? It should have said: A lament of Dovid? Rabbi Shimon ben Avishalom said a parable: To what is this similar? (It is similar) to a person about whom a promissory note was issued stating that he must repay a debt to the lender. Before he repaid it, he was despondent, worried how he will manage to repay the debt. After he repaid it, he was glad. So too was the case with Dovid. When the Holy One, Blessed be He, told him, (through Nosson the prophet, after the incident with BasSheva), “Behold, I will raise up evil against you from your house” (II Samuel 12:11), Dovid was despondent. He said: Perhaps it will be a slave or a mamzer (who will rise up in my house, a person of such lowly status,) who will have no pity on me. But once Dovid saw that it was Avshalom (i.e. that he was the one through whom the prophecy was to be fulfilled,) he rejoiced, (as he was certain that Absalom would show him mercy.) Therefore, it is called a psalm. (i.e. And not a lament, thanking G-d for punishing him in the least severe manner possible.)