def test_follow_up_question_parsing_cycle(self, mock_redis):
        """Test follow-up question persistence across request cycles"""
        mock_client = Mock()
        mock_redis.return_value = mock_client

        thread_id = "12345678-1234-1234-1234-123456789012"

        # First cycle: Assistant generates follow-up
        context = ThreadContext(
            thread_id=thread_id,
            created_at="2023-01-01T00:00:00Z",
            last_updated_at="2023-01-01T00:00:00Z",
            tool_name="debug",
            turns=[],
            initial_context={"prompt": "Debug this error"},
        )
        mock_client.get.return_value = context.model_dump_json()

        success = add_turn(
            thread_id,
            "assistant",
            "Found potential issue in authentication",
            follow_up_question="Should I examine the authentication middleware?",
        )
        assert success is True

        # Second cycle: Retrieve conversation history
        context_with_followup = ThreadContext(
            thread_id=thread_id,
            created_at="2023-01-01T00:00:00Z",
            last_updated_at="2023-01-01T00:01:00Z",
            tool_name="debug",
            turns=[
                ConversationTurn(
                    role="assistant",
                    content="Found potential issue in authentication",
                    timestamp="2023-01-01T00:00:30Z",
                    follow_up_question="Should I examine the authentication middleware?",
                )
            ],
            initial_context={"prompt": "Debug this error"},
        )
        mock_client.get.return_value = context_with_followup.model_dump_json()

        # Build history to verify follow-up is preserved
        history, tokens = build_conversation_history(context_with_followup)
        assert "Found potential issue in authentication" in history
        assert "[Gemini's Follow-up: Should I examine the authentication middleware?]" in history
Test follow-up question persistence across request cycles
tests/test_conversation_memory.py