Gemini API requires the first message to be from the 'user' role. This commit ensures that: - If a conversation starts with a 'model' (assistant) role, a placeholder 'user' message is prepended. - 'tool' results are correctly mapped to 'user' role parts. - Sequential messages with the same role are merged. - Empty content requests are prevented in both sync and stream paths. This fixes 400 Bad Request errors when clients (like opencode) send message histories that don't match Gemini's strict role requirements.